Re: AW: [ZOPE] DCOracle2 and Oi9 RC2, wrong number values in select
FYI I apologize if Mozilla converts this note in a crappy way ;) Dieter Fischer wrote:
Hello
I've a simple "Z SQL Method":
select * from zahlen
"zahlen" is the table, I've ddescribed in my email before. I can see the wrong numbers when I select the Test tab of the method.
Below the script for the Ora-Table:
CREATE TABLE ZAHLEN ( INTEGER_ INTEGER, NUMBER_10_1 NUMBER (10,1), NUMBER_10_2 NUMBER (10,2), NUMBER_10_5 NUMBER (10,5), DECIMAL_10_0 NUMBER (10), DECIMAL_10_1 NUMBER (10,1), DECIMAL_10_2 NUMBER (10,2), DECIMAL_10_5 NUMBER (10,5), REAL_ FLOAT (63), SMALLINT_ INTEGER, FLOAT_ FLOAT (10) ) ;
Regards
Dieter
I ran this, and inserted 100.5 into each column. Under Zope, I created an identical SQL method and then tested it: I got the following results: ------------------------------------------------------------------------ INTEGER NUMBER 10 1 NUMBER 10 2 NUMBER 10 5 DECIMAL 10 0 DECIMAL 10 1 DECIMAL 10 2 DECIMAL 10 5 REAL SMALLINT FLOAT 101 100.5 100.5 100.5 101 100.5 100.5 100.5 100.5 101 100.5 ------------------------------------------------------------------------ SQL used: select * from zahlen ------------------------------------------------------------------------ That's why I'm not sure what it is that you're doing differently. Under the "Debug" tab of the Connection I created, I have the following: Oracle version strings: * DCOracle2: (cvs release) -- DCOracle2 1.95 (dco2: 1.120 -DORACLE8i -DORACLE9i -DUSEOBJECT -Dlinux -D_REENTRANT ) * TNS for Linux: : 9.0.1.0.0 (Production) * Oracle9i Enterprise Edition : 9.0.1.0.0 (Production) * PL/SQL : 9.0.1.0.0 (Production) * NLSRTL : 9.0.1.0.0 (Production)
Hello My parameters in this debug tab are: PL/SQL : 9.2.0.1.0 (Production) TNS for Linux: : 9.2.0.1.0 (Production) NLSRTL : 9.2.0.1.0 (Production) Oracle9i Enterprise Edition : 9.2.0.1.0 (Production) DCOracle2: 1.2 -- DCOracle2 1.95 (dco2: 1.107 -DORACLE8i -DORACLE9i -DUSEOBJECT -Dlinux -D_REENTRANT ) I've perhaps an idea, what can be the problem. I'm trying no with the locale settings of zope. Perhaps the "." and "," gives the error. Here we have a decimal point, and not a decimal comma. I think, theres an option for Zope, I'm trying that now. Regards Dieter
Hello I've found a method to get my values correcly, but I'm not very satisfied with it: Giving zope the parameter (e.g python z2.py -Lde_CH, I hope this is correct), didn't help. So I changed the ZSQL method to that: alter session set nls_language = 'AMERICAN' <dtml-var sql_delimiter> alter session set nls_territory = 'AMERICA' <dtml-var sql_delimiter> select * from zahlen and this works. But my defaults are: nls_language = 'GERMAN' nls_territory = 'SWITZERLAND' Do I have now a problem with Zope or DCOracle2? Regards Dieter
Dieter Fischer wrote:
Hello
I've found a method to get my values correcly, but I'm not very satisfied with it:
Giving zope the parameter (e.g python z2.py -Lde_CH, I hope this is correct), didn't help.
So I changed the ZSQL method to that:
alter session set nls_language = 'AMERICAN' <dtml-var sql_delimiter> alter session set nls_territory = 'AMERICA' <dtml-var sql_delimiter> select * from zahlen
and this works. But my defaults are:
nls_language = 'GERMAN' nls_territory = 'SWITZERLAND'
Do I have now a problem with Zope or DCOracle2?
Regards
Dieter
What is the value of your LANG environment variable? DCOracle2 is using the C conversion functions to convert from string results (for precision) to the python result types. This function will change its parsing behavior based on your LANG environment variable setting. In other words, it will work when whatever sscanf(3) can parse will work. -- Matt Kromer Zope Corporation http://www.zope.com/
Hello Regarding my Problem on Wednesday, I've found a good solution to that. Before starting Zope, you have to set the correct environment Varible for the decimal sign: NLS_NUMERIC_CHARACTERS=".,"; export NLS_NUMERIC_CHARACTERS Now you can start zope. Regards Dieter
-----Ursprüngliche Nachricht----- Von: zope-admin@zope.org [mailto:zope-admin@zope.org]Im Auftrag von Matthew T. Kromer Gesendet am: Mittwoch, 2. Oktober 2002 23:10 An: Dieter Fischer Cc: Zope@Zope.Org Betreff: Re: AW: AW: [ZOPE] DCOracle2 and Oi9 RC2, wrong number values in select
Dieter Fischer wrote:
Hello
I've found a method to get my values correcly, but I'm not very satisfied with it:
Giving zope the parameter (e.g python z2.py -Lde_CH, I hope this is correct), didn't help.
So I changed the ZSQL method to that:
alter session set nls_language = 'AMERICAN' <dtml-var sql_delimiter> alter session set nls_territory = 'AMERICA' <dtml-var sql_delimiter> select * from zahlen
and this works. But my defaults are:
nls_language = 'GERMAN' nls_territory = 'SWITZERLAND'
Do I have now a problem with Zope or DCOracle2?
Regards
Dieter
What is the value of your LANG environment variable? DCOracle2 is using the C conversion functions to convert from string results (for precision) to the python result types. This function will change its parsing behavior based on your LANG environment variable setting. In other words, it will work when whatever sscanf(3) can parse will work.
-- Matt Kromer Zope Corporation http://www.zope.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Dieter Fischer -
Matthew T. Kromer