Re: [cx-oracle-users] cx-oracle-users Digest, Vol 66, Issue 4
Brought to you by:
atuining
From: Kuassi M. <kua...@gm...> - 2011-12-08 12:58:27
|
On Wed, Dec 7, 2011 at 6:08 PM, < cx-...@li...> wrote: > Send cx-oracle-users mailing list submissions to > cx-...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > or, via email, send a message with subject or body 'help' to > cx-...@li... > > You can reach the person managing the list at > cx-...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of cx-oracle-users digest..." > > > Today's Topics: > > 1. SessionPool and DRCP (Arshavir Grigorian) > 2. Passing None as values of bind variables in cx_Oracle's > cursor.execute() command (Wong Wah Meng-R32813) > 3. Re: Passing None as values of bind variables in cx_Oracle's > cursor.execute() command (Amaury Forgeot d'Arc) > 4. Re: Passing None as values of bind variables in cx_Oracle's > cursor.execute() command (Wong Wah Meng-R32813) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 6 Dec 2011 19:53:43 -0800 > From: Arshavir Grigorian <gri...@gm...> > Subject: [cx-oracle-users] SessionPool and DRCP > To: cx-...@li... > Message-ID: > <CACdn6enT8--t2SPwbqMJTtHJRriYC-0bD2SZugk+E=vOf...@ma... > > > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, can someone please explain the relationship between SessionPool > and DRCP? Do they work together or is DRCP supposed to replace > SessionPool? Thanks. > > > As indicated in the OCI doc, http://docs.oracle.com/cd/E11882_01/appdev.112/e10646.pdf Session pooling can be instructed to allocate sessions from DRCP. Kuassi Mensah http://db360.blogspot.com > ------------------------------ > > Message: 2 > Date: Wed, 7 Dec 2011 10:15:27 +0000 > From: Wong Wah Meng-R32813 <r3...@fr...> > Subject: [cx-oracle-users] Passing None as values of bind variables in > cx_Oracle's cursor.execute() command > To: "cx-...@li..." > <cx-...@li...> > Message-ID: > < > 02E...@03...> > > Content-Type: text/plain; charset="us-ascii" > > Hello there, > > I am converting my application from python 1.5.2 and oracledb to python > 2.7.1 and cx_Oracle.. > > I noticed one issue here whenever the bind variable's value is None, it > exhibits some strange behavior. > > First observation: When it is the first time I pass in a bind variable as > None, it gives an EOL file. However, subsequent passing of None value to > the same SQL seems to be working fine. > > Second observation: When there is more than one bind variables contain > None value, the value that actually got received at Oracle level seems to > be messed up. (We turn on the highest debug level at Oracle level in order > to see the bind variable value that are received). Those defined as None > are received as some arbitrary value, some are the values from one or a few > of the total bind variables. > > I read something about passing None is not supported in cx_Oracle, is it > true and is there a workaround? I think the second observation could be due > to the buffer is not flushed from a previous usage and still being used in > the subsequent call. > > Is there anyway we can get rid of both observation? Must we remove any > bind variables that we know carrying None as value in the SQL statement? > This looks like some extensive change if our application needs to verify > the value first before it being used in the SQL. > > > > Regards, > Wah Meng > Goto http://cimhelp.freescale.net to create a Genesis Wafermap Ticket. > > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Wed, 7 Dec 2011 11:27:36 +0100 > From: "Amaury Forgeot d'Arc" <ama...@gm...> > Subject: Re: [cx-oracle-users] Passing None as values of bind > variables in cx_Oracle's cursor.execute() command > To: cx-...@li... > Message-ID: > <CAGmFidbhf7WazwtfKq9g26Yx2xk7HAmhG2zvry=VXX...@ma... > > > Content-Type: text/plain; charset="windows-1252" > > Hi, > > 2011/12/7 Wong Wah Meng-R32813 <r3...@fr...> > > > Hello there,**** > > > > ** ** > > > > I am converting my application from python 1.5.2 and oracledb to python > > 2.7.1 and cx_Oracle.. **** > > > > ** ** > > > > I noticed one issue here whenever the bind variable?s value is None, it > > exhibits some strange behavior.**** > > > > ** ** > > > > First observation: When it is the first time I pass in a bind variable as > > None, it gives an EOL file. However, subsequent passing of None value to > > the same SQL seems to be working fine. > > > > This is surprising. But what do you mean by "EOL file"? > > > > Second observation: When there is more than one bind variables contain > > None value, the value that actually got received at Oracle level seems to > > be messed up. (We turn on the highest debug level at Oracle level in > order > > to see the bind variable value that are received). Those defined as None > > are received as some arbitrary value, some are the values from one or a > few > > of the total bind variables. > > > > When None is passed, cx_Oracle sets the "NULL indicator" of the bind > variable. But this changes only one bit of the memory, so if you look at > the raw memory, it will indeed contain random data except for the "NULL > indicator" bit. > > > > I read something about passing None is not supported in cx_Oracle, is it > > true and is there a workaround? I think the second observation could be > due > > to the buffer is not flushed from a previous usage and still being used > in > > the subsequent call. **** > > > > ** ** > > > > Is there anyway we can get rid of both observation? Must we remove any > > bind variables that we know carrying None as value in the SQL statement? > > This looks like some extensive change if our application needs to verify > > the value first before it being used in the SQL. > > > > The None value *is* supported. There used to be an issue when > cursor.executemany() determines the type of a variable, when the first > value for this variable is a None and following values are numbers. > But this caused an explicit conversion error, and it has been fixed some > releases ago anyway. > > Could you show us a test script that reproduces your problem? > > -- > Amaury Forgeot d'Arc > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 4 > Date: Thu, 8 Dec 2011 02:08:00 +0000 > From: Wong Wah Meng-R32813 <r3...@fr...> > Subject: Re: [cx-oracle-users] Passing None as values of bind > variables in cx_Oracle's cursor.execute() command > To: "cx-...@li..." > <cx-...@li...> > Message-ID: > < > 78E...@03...> > > Content-Type: text/plain; charset="us-ascii" > > Thanks for your reply. Based on your None as bind variable's value *is* > supported, I would like to redo my testing to reaffirm the case before > updating you my test script. Maybe something was introduced in my > inputtypehandler of the cursor object. I will revert with my findings later. > > From: Amaury Forgeot d'Arc [mailto:ama...@gm...] > Sent: Wednesday, December 07, 2011 6:28 PM > To: cx-...@li... > Subject: Re: [cx-oracle-users] Passing None as values of bind variables in > cx_Oracle's cursor.execute() command > > Hi, > 2011/12/7 Wong Wah Meng-R32813 <r3...@fr...<mailto: > r3...@fr...>> > Hello there, > > I am converting my application from python 1.5.2 and oracledb to python > 2.7.1 and cx_Oracle.. > > I noticed one issue here whenever the bind variable's value is None, it > exhibits some strange behavior. > > First observation: When it is the first time I pass in a bind variable as > None, it gives an EOL file. However, subsequent passing of None value to > the same SQL seems to be working fine. > > This is surprising. But what do you mean by "EOL file"? > > Second observation: When there is more than one bind variables contain > None value, the value that actually got received at Oracle level seems to > be messed up. (We turn on the highest debug level at Oracle level in order > to see the bind variable value that are received). Those defined as None > are received as some arbitrary value, some are the values from one or a few > of the total bind variables. > > When None is passed, cx_Oracle sets the "NULL indicator" of the bind > variable. But this changes only one bit of the memory, so if you look at > the raw memory, it will indeed contain random data except for the "NULL > indicator" bit. > > I read something about passing None is not supported in cx_Oracle, is it > true and is there a workaround? I think the second observation could be due > to the buffer is not flushed from a previous usage and still being used in > the subsequent call. > > Is there anyway we can get rid of both observation? Must we remove any > bind variables that we know carrying None as value in the SQL statement? > This looks like some extensive change if our application needs to verify > the value first before it being used in the SQL. > > The None value *is* supported. There used to be an issue when > cursor.executemany() determines the type of a variable, when the first > value for this variable is a None and following values are numbers. > But this caused an explicit conversion error, and it has been fixed some > releases ago anyway. > > Could you show us a test script that reproduces your problem? > > -- > Amaury Forgeot d'Arc > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Cloud Services Checklist: Pricing and Packaging Optimization > This white paper is intended to serve as a reference, checklist and point > of > discussion for anyone considering optimizing the pricing and packaging > model > of a cloud services business. Read Now! > http://www.accelacomm.com/jaw/sfnl/114/51491232/ > > ------------------------------ > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > End of cx-oracle-users Digest, Vol 66, Issue 4 > ********************************************** > -- Kuassi - book http://www.amazon.com/exec/obidos/ASIN/1555583296 |