Re: [cx-oracle-users] Oracle Error :: ORA-01484 arrays can only be bound to PL/SQL statements
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2011-12-01 04:28:57
|
Oracle does not allow passing arrays to SQL statements, only PL/SQL statements and this has been that way since as long as I have known Oracle. The driver you were using before may have simply converted the result to a string. cx_Oracle takes lists and converts them to PL/SQL arrays -- which are not possible to be used in straight SQL statements. So you will have to modify how you are using the driver. In my opinion, converting lists to strings in some arbitrary fashion is not the best way to handle such things! Anthony On Wed, Nov 30, 2011 at 7:07 PM, Wong Wah Meng-R32813 <r3...@fr...> wrote: > Yes worst case is we will have to modify this SQL statement. > > > > However, is it a long standing issue with Oracle or cx_Oracle? This is an > old code and the passing of parameters in such way has been working fine on > oracledb. So is this something the cx_Oracle does not support? IF it is > oracle issue I wonder whey it did not give the error when we use oracledb. > > > > Regards, > > Wah Meng > > ________________________________ > > From: Amaury Forgeot d'Arc [mailto:ama...@gm...] > Sent: Wednesday, November 30, 2011 9:06 PM > > To: cx-...@li... > Subject: Re: [cx-oracle-users] Oracle Error :: ORA-01484 arrays can only be > bound to PL/SQL statements > > > > 2011/11/30 Wong Wah Meng-R32813 <r3...@fr...> > >>> cmd = “select …….. from FUTURE_HOLD_CONDITIONS where STEP_NAME not in >>> (:1) and LOT_ID = :2 and …….” > > This cannot work with Oracle. A placeholder can only replace one value. > > (Think of the IN operator as a sequence of OR conditions) > > Yes, this is a long standing issue with Oracle. > > I suggest to try with %s formatting. > > > > -- > Amaury Forgeot d'Arc > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |