cx-oracle-users Mailing List for cx_Oracle (Page 37)
Brought to you by:
atuining
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(9) |
Sep
(8) |
Oct
(12) |
Nov
(4) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(15) |
Feb
(12) |
Mar
(11) |
Apr
(5) |
May
(7) |
Jun
(8) |
Jul
(12) |
Aug
(2) |
Sep
(14) |
Oct
(17) |
Nov
(20) |
Dec
(3) |
2005 |
Jan
(16) |
Feb
(9) |
Mar
(22) |
Apr
(21) |
May
(73) |
Jun
(16) |
Jul
(15) |
Aug
(10) |
Sep
(32) |
Oct
(35) |
Nov
(22) |
Dec
(13) |
2006 |
Jan
(42) |
Feb
(36) |
Mar
(13) |
Apr
(18) |
May
(8) |
Jun
(17) |
Jul
(24) |
Aug
(30) |
Sep
(35) |
Oct
(33) |
Nov
(33) |
Dec
(11) |
2007 |
Jan
(35) |
Feb
(31) |
Mar
(35) |
Apr
(64) |
May
(38) |
Jun
(12) |
Jul
(18) |
Aug
(34) |
Sep
(75) |
Oct
(29) |
Nov
(51) |
Dec
(11) |
2008 |
Jan
(27) |
Feb
(46) |
Mar
(48) |
Apr
(36) |
May
(59) |
Jun
(42) |
Jul
(25) |
Aug
(34) |
Sep
(57) |
Oct
(97) |
Nov
(59) |
Dec
(57) |
2009 |
Jan
(48) |
Feb
(48) |
Mar
(45) |
Apr
(24) |
May
(46) |
Jun
(52) |
Jul
(52) |
Aug
(37) |
Sep
(27) |
Oct
(40) |
Nov
(37) |
Dec
(13) |
2010 |
Jan
(16) |
Feb
(9) |
Mar
(24) |
Apr
(6) |
May
(27) |
Jun
(28) |
Jul
(60) |
Aug
(16) |
Sep
(33) |
Oct
(20) |
Nov
(39) |
Dec
(30) |
2011 |
Jan
(23) |
Feb
(43) |
Mar
(16) |
Apr
(29) |
May
(23) |
Jun
(16) |
Jul
(10) |
Aug
(8) |
Sep
(18) |
Oct
(42) |
Nov
(26) |
Dec
(20) |
2012 |
Jan
(17) |
Feb
(27) |
Mar
|
Apr
(20) |
May
(18) |
Jun
(7) |
Jul
(24) |
Aug
(21) |
Sep
(23) |
Oct
(18) |
Nov
(12) |
Dec
(5) |
2013 |
Jan
(14) |
Feb
(10) |
Mar
(20) |
Apr
(65) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(3) |
Sep
|
Oct
(3) |
Nov
(28) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(9) |
Mar
(4) |
Apr
(7) |
May
(20) |
Jun
(2) |
Jul
(20) |
Aug
(7) |
Sep
(11) |
Oct
(8) |
Nov
(6) |
Dec
(12) |
2015 |
Jan
(16) |
Feb
(10) |
Mar
(14) |
Apr
(8) |
May
|
Jun
(8) |
Jul
(15) |
Aug
(7) |
Sep
(1) |
Oct
(33) |
Nov
(8) |
Dec
(5) |
2016 |
Jan
(18) |
Feb
(12) |
Mar
(6) |
Apr
(14) |
May
(5) |
Jun
(3) |
Jul
|
Aug
(21) |
Sep
|
Oct
(15) |
Nov
(8) |
Dec
|
2017 |
Jan
|
Feb
(14) |
Mar
(21) |
Apr
(9) |
May
(6) |
Jun
(11) |
Jul
(23) |
Aug
(6) |
Sep
(5) |
Oct
(7) |
Nov
(1) |
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(16) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
(7) |
May
(6) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark H. <mh...@pi...> - 2011-11-02 16:15:28
|
On 11/2/11 2:49 AM, Paul Moore wrote: > On 2 November 2011 03:22, Victor Hooi<vic...@ya...> wrote: >> Is there any way at all to get COPY to work from cx_Oracle? Or any other way >> to achieve the same thing just as elegantly, and not iterate through >> records? > > Check out cx_OracleTools: http://cx-oracletools.sourceforge.net/ - > there's a CopyData tool. > > Note - I haven't actually used these myself, but they seem to do the > sort of thing you're after. cx_OracleTools are amazing. Anybody not using them should check them out! |
From: Paul M. <p.f...@gm...> - 2011-11-02 09:49:55
|
On 2 November 2011 03:22, Victor Hooi <vic...@ya...> wrote: > Is there any way at all to get COPY to work from cx_Oracle? Or any other way > to achieve the same thing just as elegantly, and not iterate through > records? Check out cx_OracleTools: http://cx-oracletools.sourceforge.net/ - there's a CopyData tool. Note - I haven't actually used these myself, but they seem to do the sort of thing you're after. Paul. |
From: Victor H. <vic...@ya...> - 2011-11-02 03:22:55
|
Hi, We have two separate schemas on different Oracle database instances, and we have a need to copy the records from certain tables from one to the other. Due to internal regulations, creating a database link between them isn't an option - so I suppose that rules our using INSERT INTO...SELECT, right? Previously, we were using SQL*PLUS's COPY extension: http://www.oracleutilities.com/SQLPLus/copy.html and this has worked really well. However, now we'd like to automate this, and so I figured cx_Oracle would be the way to go. However, I don't think I can use COPY from cx_Oracle since it's SQL*PLUS specific ( http://stackoverflow.com/questions/7963441/using-sqlplus-copy-from-inside-cx-oracle ). Is there any way at all to get COPY to work from cx_Oracle? Or any other way to achieve the same thing just as elegantly, and not iterate through records? Cheers, Victor |
From: Christopher J. <chr...@or...> - 2011-10-25 23:24:52
|
An Oracle Unstructured Data with Multimeda SIG has been launched by Marcelle Kratochvil from Piction. She is looking for Oracle-user assistance, particularly regarding scripting languages such as Python. Marcelle introduced the SIG in a session at the recent Oracle OpenWorld conference in San Francisco. She is well connected to Oracle development teams and is in a great position to help shape future versions of Oracle and MySQL databases with your input. There is a placeholder site for the SIG at https://sites.google.com/site/ommuds/ If you'd like to get involved, contact Marcelle directly at mar...@pi... Chris -- Email: chr...@or... Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ |
From: Anthony T. <ant...@gm...> - 2011-10-25 01:58:17
|
If that is the case, let me suggest that you were using Unicode without meaning to. You can also upgrade to 5.1 which allows you to pass Unicode as query strings. Anthony On Mon, Oct 24, 2011 at 1:18 PM, Anurag Chourasia <anu...@gm...> wrote: > Actually, upon reading the link sent by Andres further, I could make it to > work by changing > cursor.execute(query) > to > cursor.execute(str(query)) > > Regards, > Anurag > > On Tue, Oct 25, 2011 at 12:40 AM, Anurag Chourasia > <anu...@gm...> wrote: >> >> Thanks for the response Andreas but I am already passing string type >> objects in the substitution variables. >> This is really strange as this was working fine before and works fine from >> most places.. >> >> On Tue, Oct 25, 2011 at 12:30 AM, Andreas Mock <and...@we...> >> wrote: >>> >>> Hi Anurag, >>> >>> >>> >>> searching for your error message with google brought this >>> >>> as one of the top results. Probably it helps: >>> >>> >>> http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html >>> >>> >>> >>> Best regards >>> >>> Andreas Mock >>> >>> >>> >>> >>> >>> From: Anurag Chourasia [mailto:anu...@gm...] >>> Sent: Monday, October 24, 2011 8:39 PM >>> To: cx-...@li...; lar...@gm... >>> Subject: Re: [cx-oracle-users] expecting None or a string >>> >>> >>> >>> The print returns this >>> >>> >>> >>> SELECT count(*) FROM T WHERE NBR = '1' and ID='1' >>> >>> >>> >>> Both NBR and ID are varchar in my case. >>> >>> >>> >>> This query works fine when executed directly using Oracle PL/SQL Plus >>> >>> >>> >>> Regards, >>> >>> Anurag >>> >>> >>> >>> On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> >>> wrote: >>> >>> On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia >>> <anu...@gm...> wrote: >>> > Hi All, >>> > I am getting an error "expecting None or a string" when executing a >>> > simple >>> > SQL Query as this. >>> > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) >>> > print query >>> > cursor.execute(query) >>> > This was working fine before and I have neither changed the code nor >>> > update >>> > cx_Oracle or Oracle version etc. >>> >>> Well, what do you get when you print out the query? nrb or id probably >>> don't have the value you think. >>> >>> >>> ------------------------------------------------------------------------------ >>> The demand for IT networking professionals continues to grow, and the >>> demand for specialized networking skills is growing even more rapidly. >>> Take a complimentary Learning@Cisco Self-Assessment and learn >>> about Cisco certifications, training, and career opportunities. >>> http://p.sf.net/sfu/cisco-dev2dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> The demand for IT networking professionals continues to grow, and the >>> demand for specialized networking skills is growing even more rapidly. >>> Take a complimentary Learning@Cisco Self-Assessment and learn >>> about Cisco certifications, training, and career opportunities. >>> http://p.sf.net/sfu/cisco-dev2dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >> > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Anurag C. <anu...@gm...> - 2011-10-24 19:18:37
|
Actually, upon reading the link sent by Andres further, I could make it to work by changing cursor.execute(query) to cursor.execute(str(query)) Regards, Anurag On Tue, Oct 25, 2011 at 12:40 AM, Anurag Chourasia < anu...@gm...> wrote: > Thanks for the response Andreas but I am already passing string type > objects in the substitution variables. > > This is really strange as this was working fine before and works fine from > most places.. > > > On Tue, Oct 25, 2011 at 12:30 AM, Andreas Mock <and...@we...>wrote: > >> Hi Anurag,**** >> >> ** ** >> >> searching for your error message with google brought this**** >> >> as one of the top results. Probably it helps:**** >> >> http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html >> **** >> >> ** ** >> >> Best regards**** >> >> Andreas Mock**** >> >> ** ** >> >> ** ** >> >> *From:* Anurag Chourasia [mailto:anu...@gm...] >> *Sent:* Monday, October 24, 2011 8:39 PM >> *To:* cx-...@li...; lar...@gm... >> *Subject:* Re: [cx-oracle-users] expecting None or a string**** >> >> ** ** >> >> The print returns this**** >> >> ** ** >> >> SELECT count(*) FROM T WHERE NBR = '1' and ID='1'**** >> >> ** ** >> >> Both NBR and ID are varchar in my case.**** >> >> ** ** >> >> This query works fine when executed directly using Oracle PL/SQL Plus**** >> >> ** ** >> >> Regards,**** >> >> Anurag**** >> >> ** ** >> >> On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> >> wrote:**** >> >> On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia >> <anu...@gm...> wrote: >> > Hi All, >> > I am getting an error "expecting None or a string" when executing a >> simple >> > SQL Query as this. >> > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) >> > print query >> > cursor.execute(query) >> > This was working fine before and I have neither changed the code nor >> update >> > cx_Oracle or Oracle version etc.**** >> >> Well, what do you get when you print out the query? nrb or id probably >> don't have the value you think. >> >> >> ------------------------------------------------------------------------------ >> The demand for IT networking professionals continues to grow, and the >> demand for specialized networking skills is growing even more rapidly. >> Take a complimentary Learning@Cisco Self-Assessment and learn >> about Cisco certifications, training, and career opportunities. >> http://p.sf.net/sfu/cisco-dev2dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users**** >> >> ** ** >> >> >> ------------------------------------------------------------------------------ >> The demand for IT networking professionals continues to grow, and the >> demand for specialized networking skills is growing even more rapidly. >> Take a complimentary Learning@Cisco Self-Assessment and learn >> about Cisco certifications, training, and career opportunities. >> http://p.sf.net/sfu/cisco-dev2dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > |
From: Anurag C. <anu...@gm...> - 2011-10-24 19:11:12
|
Thanks for the response Andreas but I am already passing string type objects in the substitution variables. This is really strange as this was working fine before and works fine from most places.. On Tue, Oct 25, 2011 at 12:30 AM, Andreas Mock <and...@we...> wrote: > Hi Anurag,**** > > ** ** > > searching for your error message with google brought this**** > > as one of the top results. Probably it helps:**** > > http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html > **** > > ** ** > > Best regards**** > > Andreas Mock**** > > ** ** > > ** ** > > *From:* Anurag Chourasia [mailto:anu...@gm...] > *Sent:* Monday, October 24, 2011 8:39 PM > *To:* cx-...@li...; lar...@gm... > *Subject:* Re: [cx-oracle-users] expecting None or a string**** > > ** ** > > The print returns this**** > > ** ** > > SELECT count(*) FROM T WHERE NBR = '1' and ID='1'**** > > ** ** > > Both NBR and ID are varchar in my case.**** > > ** ** > > This query works fine when executed directly using Oracle PL/SQL Plus**** > > ** ** > > Regards,**** > > Anurag**** > > ** ** > > On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> > wrote:**** > > On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia > <anu...@gm...> wrote: > > Hi All, > > I am getting an error "expecting None or a string" when executing a > simple > > SQL Query as this. > > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) > > print query > > cursor.execute(query) > > This was working fine before and I have neither changed the code nor > update > > cx_Oracle or Oracle version etc.**** > > Well, what do you get when you print out the query? nrb or id probably > don't have the value you think. > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users**** > > ** ** > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Andreas M. <and...@we...> - 2011-10-24 19:00:58
|
Hi Anurag, searching for your error message with google brought this as one of the top results. Probably it helps: http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html Best regards Andreas Mock From: Anurag Chourasia [mailto:anu...@gm...] Sent: Monday, October 24, 2011 8:39 PM To: cx-...@li...; lar...@gm... Subject: Re: [cx-oracle-users] expecting None or a string The print returns this SELECT count(*) FROM T WHERE NBR = '1' and ID='1' Both NBR and ID are varchar in my case. This query works fine when executed directly using Oracle PL/SQL Plus Regards, Anurag On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> wrote: On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia <anu...@gm...> wrote: > Hi All, > I am getting an error "expecting None or a string" when executing a simple > SQL Query as this. > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) > print query > cursor.execute(query) > This was working fine before and I have neither changed the code nor update > cx_Oracle or Oracle version etc. Well, what do you get when you print out the query? nrb or id probably don't have the value you think. ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anurag C. <anu...@gm...> - 2011-10-24 18:39:07
|
The print returns this SELECT count(*) FROM T WHERE NBR = '1' and ID='1' Both NBR and ID are varchar in my case. This query works fine when executed directly using Oracle PL/SQL Plus Regards, Anurag On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...>wrote: > On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia > <anu...@gm...> wrote: > > Hi All, > > I am getting an error "expecting None or a string" when executing a > simple > > SQL Query as this. > > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) > > print query > > cursor.execute(query) > > This was working fine before and I have neither changed the code nor > update > > cx_Oracle or Oracle version etc. > > Well, what do you get when you print out the query? nrb or id probably > don't have the value you think. > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Larry M. <lar...@gm...> - 2011-10-24 18:36:01
|
On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia <anu...@gm...> wrote: > Hi All, > I am getting an error "expecting None or a string" when executing a simple > SQL Query as this. > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) > print query > cursor.execute(query) > This was working fine before and I have neither changed the code nor update > cx_Oracle or Oracle version etc. Well, what do you get when you print out the query? nrb or id probably don't have the value you think. |
From: Anurag C. <anu...@gm...> - 2011-10-24 18:31:39
|
Hi All, I am getting an error "expecting None or a string" when executing a simple SQL Query as this. query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) print query cursor.execute(query) This was working fine before and I have neither changed the code nor update cx_Oracle or Oracle version etc. Please Guide. Regards, Anurag |
From: <qui...@gm...> - 2011-10-20 19:06:15
|
Thank you for your reply.<br>I'll try this offset tomorrow (it is the evening where I leave) <br><span style="font-family:Prelude, Verdana, san-serif;"><br><br></span><span id="signature"><div style="font-family: arial, sans-serif; font-size: 12px;color: #999999">-- Envoyé depuis mon HP TouchPad</div></span><span style="color:navy; font-family:Prelude, Verdana, san-serif; "><hr align="left" style="width:75%">Le 20 oct. 2011 18:05, Anthony Tuininga <ant...@gm...> a écrit : <br></span>Hi, <br> <br>On the error object there is an "offset" value which will give you <br>that information. Also, the rowcount is set to the number of rows that <br>were successfully processed if I recall correctly. <br> <br>Anthony <br> <br>On Thu, Oct 20, 2011 at 7:49 AM, Quiche Obscure <br><qui...@gm...> wrote: <br>> Hello, <br>> <br>> I am trying to import millions of rows in a table with executemany. <br>> <br>> Fiew of them are rejected by oracle because of various problems (not null <br>> constraint, format number ...). <br>> <br>> If I do this : <br>> <br>> ################################################################## <br>> insert = """ INSERT INTO mytable (col1,col2,col3) VALUES (:1, :2, :3)""" <br>> L = [] <br>> reader = csv.reader(open(infile), delimiter=';') <br>> i=0 <br>> for row in reader: <br>> L.append(row) <br>> if(i>10000): <br>> try: <br>> cursor.prepare(insert) <br>> cursor.executemany(None, L) <br>> cursor.commit() <br>> i=0 <br>> except cx_Oracle.DatabaseError,exc: <br>> error, = exc.args <br>> mess="\nOracle-Error-Code:"+str(error.code) <br>> mess+="\nOracle-Error-Message:"+str(error.message) <br>> mess+="\nOracle-Error-context:"+str(error.context) <br>> mess+="\nTOUS:"+str(exc) <br>> sys.exit(mess) <br>> i+=1 <br>> <br>> ################################################################## <br>> <br>> I don't know the way to find out in the DatabaseError which row is causing <br>> the exception. <br>> <br>> Any idea ? <br>> <br>> ------------------------------------------------------------------------------ <br>> The demand for IT networking professionals continues to grow, and the <br>> demand for specialized networking skills is growing even more rapidly. <br>> Take a complimentary Learning@Ciosco Self-Assessment and learn <br>> about Cisco certifications, training, and career opportunities. <br>> http://p.sf.net/sfu/cisco-dev2dev <br>> _______________________________________________ <br>> cx-oracle-users mailing list <br>> cx-...@li... <br>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users <br>> <br>> <br> <br>------------------------------------------------------------------------------ <br>The demand for IT networking professionals continues to grow, and the <br>demand for specialized networking skills is growing even more rapidly. <br>Take a complimentary Learning@Ciosco Self-Assessment and learn <br>about Cisco certifications, training, and career opportunities. <br>http://p.sf.net/sfu/cisco-dev2dev <br>_______________________________________________ <br>cx-oracle-users mailing list <br>cx-...@li... <br>https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anthony T. <ant...@gm...> - 2011-10-20 16:04:55
|
Hi, On the error object there is an "offset" value which will give you that information. Also, the rowcount is set to the number of rows that were successfully processed if I recall correctly. Anthony On Thu, Oct 20, 2011 at 7:49 AM, Quiche Obscure <qui...@gm...> wrote: > Hello, > > I am trying to import millions of rows in a table with executemany. > > Fiew of them are rejected by oracle because of various problems (not null > constraint, format number ...). > > If I do this : > > ################################################################## > insert = """ INSERT INTO mytable (col1,col2,col3) VALUES (:1, :2, :3)""" > L = [] > reader = csv.reader(open(infile), delimiter=';') > i=0 > for row in reader: > L.append(row) > if(i>10000): > try: > cursor.prepare(insert) > cursor.executemany(None, L) > cursor.commit() > i=0 > except cx_Oracle.DatabaseError,exc: > error, = exc.args > mess="\nOracle-Error-Code:"+str(error.code) > mess+="\nOracle-Error-Message:"+str(error.message) > mess+="\nOracle-Error-context:"+str(error.context) > mess+="\nTOUS:"+str(exc) > sys.exit(mess) > i+=1 > > ################################################################## > > I don't know the way to find out in the DatabaseError which row is causing > the exception. > > Any idea ? > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Ciosco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Quiche O. <qui...@gm...> - 2011-10-20 13:49:19
|
Hello, I am trying to import millions of rows in a table with executemany. Fiew of them are rejected by oracle because of various problems (not null constraint, format number ...). If I do this : ################################################################## insert = """ INSERT INTO mytable (col1,col2,col3) VALUES (:1, :2, :3)""" L = [] reader = csv.reader(open(infile), delimiter=';') i=0 for row in reader: L.append(row) if(i>10000): try: cursor.prepare(insert) cursor.executemany(None, L) cursor.commit() i=0 except cx_Oracle.DatabaseError,exc: error, = exc.args mess="\nOracle-Error-Code:"+str(error.code) mess+="\nOracle-Error-Message:"+str(error.message) mess+="\nOracle-Error-context:"+str(error.context) mess+="\nTOUS:"+str(exc) sys.exit(mess) i+=1 ################################################################## I don't know the way to find out in the DatabaseError which row is causing the exception. Any idea ? |
From: inkblotter <ink...@gm...> - 2011-10-20 05:22:21
|
Two things that might be causing your problems. 1) Use LD_LIBRARY_PATH instead of LIBPATH, unset $LIBPATH Also your LD_LIBRARY_PATH should also include $ORACLE_HOME/lib 2) Copy that command to build cx_Oracle.so to an arbitrary new file, I usually use a file called 'doit', and change it like this /usr/vacpp/bin/xlC_r -qflag=w:w -qstaticinline -qfuncsect -qnotempinc -q64 -qcheck=nobounds:div:null -qlanglvl=ansi -qlonglong -D_REENTRANT -brtl -bnolibpath -L./ -qmkshrobj build/temp.aix-6.1-2.5-10g/cx_Oracle.o -L/u01/app/oracle/product/11.2.0/client_1/lib -L/u01/app/oracle/product/11.2.0/client_1 -lclntsh -L/app/sapbods/dataservices/DataQuality/python/lib -lpython2.5 -o build/lib.aix-6.1-2.5-10g/cx_Oracle.so Then chmod +x doit ./doit If that works without errors python setup.py install If it doesn't work try /usr/vacpp/bin/xlC_r -qflag=w:w -qstaticinline -qfuncsect -qnotempinc -q64 -qcheck=nobounds:div:null -qlanglvl=ansi -qlonglong -D_REENTRANT -brtl -bnolibpath -L./ -qmkshrobj build/temp.aix-6.1-2.5-10g/cx_Oracle.o -L/u01/app/oracle/product/11.2.0/client_1/lib -L/u01/app/oracle/product/11.2.0/client_1 -lclntsh /app/sapbods/dataservices/DataQuality/python/lib/libpython2.5.so -o build/lib.aix-6.1-2.5-10g/cx_Oracle.so Though I hope you don't need this hack, it's AIX! If neither of these things manages to make cx_Oracle.so, tell me what xlC -qversion reports and oslevel -s Good luck. I have built cx_Oracle on AIX 5.3, 6.1, and 7.1, so it is possible. On 10/19/2011 04:49 PM, Brij M Pandey wrote: > Hi , > > Am facing the below errors: > > Here is the platform info: > 1> uname -a > AIX 1 6 00CB4BD54C00 > > 2> ldd /app/sapbods/dataservices/DataQuality/python/bin/python > > /app/sapbods/dataservices/DataQuality/python/bin/python needs: > /app/sapbods/dataservices/DataQuality/python/lib/libpython2.5.so > /usr/lib/libpthread.a(shr_xpg5_64.o) > /usr/lib/libc.a(shr_64.o) > /usr/lib/libdl.a(shr_64.o) > /unix > /usr/lib/libcrypt.a(shr_64.o) > > > 3> LIBPATH: > /app/sapbods/dataservices/DataQuality/python/lib > > /app/sapbods/dataservices/DataQuality/python/bin/python setup.py build > running build > running build_ext > building 'cx_Oracle' extension > /usr/vacpp/bin/xlC_r -qflag=w:w -qstaticinline -qfuncsect -qnotempinc -q64 > -qcheck=nobounds:div:null -qlanglvl=ansi -qlonglong -D_REENTRANT -brtl > -bnolibpath -L./ -qmkshrobj build/temp.aix-6.1-2.5-10g/cx_Oracle.o > -L/u01/app/oracle/product/11.2.0/client_1/lib > -L/u01/app/oracle/product/11.2.0/client_1 -lclntsh -lpython2.5 -o > build/lib.aix-6.1-2.5-10g/cx_Oracle.so > ld: 0706-006 Cannot find or open library file: -l python2.5 > ld:open(): A file or directory in the path name does not exist. > error: command '/usr/vacpp/bin/xlC_r' failed with exit status 255 > > > > PLease help or suggest. > > Thanks > Brij > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Ciosco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Brij M P. <brp...@in...> - 2011-10-19 21:51:06
|
Hi , Am facing the below errors: Here is the platform info: 1> uname -a AIX 1 6 00CB4BD54C00 2> ldd /app/sapbods/dataservices/DataQuality/python/bin/python /app/sapbods/dataservices/DataQuality/python/bin/python needs: /app/sapbods/dataservices/DataQuality/python/lib/libpython2.5.so /usr/lib/libpthread.a(shr_xpg5_64.o) /usr/lib/libc.a(shr_64.o) /usr/lib/libdl.a(shr_64.o) /unix /usr/lib/libcrypt.a(shr_64.o) 3> LIBPATH: /app/sapbods/dataservices/DataQuality/python/lib /app/sapbods/dataservices/DataQuality/python/bin/python setup.py build running build running build_ext building 'cx_Oracle' extension /usr/vacpp/bin/xlC_r -qflag=w:w -qstaticinline -qfuncsect -qnotempinc -q64 -qcheck=nobounds:div:null -qlanglvl=ansi -qlonglong -D_REENTRANT -brtl -bnolibpath -L./ -qmkshrobj build/temp.aix-6.1-2.5-10g/cx_Oracle.o -L/u01/app/oracle/product/11.2.0/client_1/lib -L/u01/app/oracle/product/11.2.0/client_1 -lclntsh -lpython2.5 -o build/lib.aix-6.1-2.5-10g/cx_Oracle.so ld: 0706-006 Cannot find or open library file: -l python2.5 ld:open(): A file or directory in the path name does not exist. error: command '/usr/vacpp/bin/xlC_r' failed with exit status 255 PLease help or suggest. Thanks Brij |
From: Anthony T. <ant...@gm...> - 2011-10-19 18:15:57
|
That sort of thing could be an Oracle bug caused by some SQL you are executing that it doesn't like for some reason....or it could be the fact that you are trying to use multiple connections at the same time and you haven't turned on threaded = True. I would suggest doing that first and seeing if the problem persists. If it does, you'll probably have to find out what SQL is causing the problem and rework it or call up Oracle support. Anthony On Wed, Oct 19, 2011 at 11:47 AM, Mccully, Sean <Sea...@tu...> wrote: > > I have been experiencing frequent crashes to my python application, in > connection to using the cx_Oracle module. The application seems to just go > away, with-out any stack trace and seems related to the oracle client > crashing. Since oracle is creating these trace files at the time of > application crash. > > Using > -cx_Oracle v5.0 > -Oracle Client 11.2 64bit. > -python 2.6.5 > -storm 0.14.283.1 > > ============================================================ > ora_7250_140122180073216.trc > Trace file > /usr/lib64/oracle/11.2/client64/lib/log/diag/clients/user_veasutil/host_2513 > 739421_80/trace/ora_7250_140122180073216.trc > kpedbg_dmp_stack()+360<-kpeDbgCrash()+192<-kpudfn()+1124<-OCIDefineByPos()+5 > 7<-Cursor_PerformDefine()+401<-00007F70B92D55C0 > ============================================================= > ora_7250_140122180073216.trm > @2|2|VU5pWg-J1"7250_140122180073216|host_2513739421_80| > 6/Prcd-V-J1~42M > 3?6fUBYA~0J > ============================================================== > > I have been unable to actually reproduce these types of crashes, and not > sure where in the stack is causing these crashes to happen. > > Sean > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Ciosco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Gaius H. <Ga...@Ga...> - 2011-10-19 18:13:23
|
I think in this case you should open a TAR on Metalink. Cheers, G ------------------ -----Original Message----- From: "Mccully, Sean" <Sea...@tu...> Date: Wed, 19 Oct 2011 13:47:13 To: cx-...@li...<cx-...@li...> Reply-To: cx-...@li... Subject: [cx-oracle-users] Oracle Dumps I have been experiencing frequent crashes to my python application, in connection to using the cx_Oracle module. The application seems to just go away, with-out any stack trace and seems related to the oracle client crashing. Since oracle is creating these trace files at the time of application crash. Using -cx_Oracle v5.0 -Oracle Client 11.2 64bit. -python 2.6.5 -storm 0.14.283.1 ============================================================ ora_7250_140122180073216.trc Trace file /usr/lib64/oracle/11.2/client64/lib/log/diag/clients/user_veasutil/host_2513 739421_80/trace/ora_7250_140122180073216.trc kpedbg_dmp_stack()+360<-kpeDbgCrash()+192<-kpudfn()+1124<-OCIDefineByPos()+5 7<-Cursor_PerformDefine()+401<-00007F70B92D55C0 ============================================================= ora_7250_140122180073216.trm @2|2|VU5pWg-J1"7250_140122180073216|host_2513739421_80| 6/Prcd-V-J1~42M 3?6fUBYA~0J ============================================================== I have been unable to actually reproduce these types of crashes, and not sure where in the stack is causing these crashes to happen. Sean ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Ciosco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Mccully, S. <Sea...@tu...> - 2011-10-19 17:43:49
|
I have been experiencing frequent crashes to my python application, in connection to using the cx_Oracle module. The application seems to just go away, with-out any stack trace and seems related to the oracle client crashing. Since oracle is creating these trace files at the time of application crash. Using -cx_Oracle v5.0 -Oracle Client 11.2 64bit. -python 2.6.5 -storm 0.14.283.1 ============================================================ ora_7250_140122180073216.trc Trace file /usr/lib64/oracle/11.2/client64/lib/log/diag/clients/user_veasutil/host_2513 739421_80/trace/ora_7250_140122180073216.trc kpedbg_dmp_stack()+360<-kpeDbgCrash()+192<-kpudfn()+1124<-OCIDefineByPos()+5 7<-Cursor_PerformDefine()+401<-00007F70B92D55C0 ============================================================= ora_7250_140122180073216.trm @2|2|VU5pWg-J1"7250_140122180073216|host_2513739421_80| 6/Prcd-V-J1~42M 3?6fUBYA~0J ============================================================== I have been unable to actually reproduce these types of crashes, and not sure where in the stack is causing these crashes to happen. Sean |
From: Anthony T. <ant...@gm...> - 2011-10-17 17:09:02
|
Hi, >From what I understand, RECORD cannot be passed via OCI. It is a PL/SQL only construct like booleans. So this cannot be done directly. You will need to do something like this instead: sql = """ declare t_Options dbms_aq.options_t; begin t_Options.relative_msgid := :msgId; dbms_aq.enqueue(:queueName, t_Options....); end;""" cursor.execute(sql, msgId = '??', queueName = '??') Expand as needed for the other items. Hope that helps. Anthony On Sun, Oct 16, 2011 at 9:30 PM, yi huang <yi....@gm...> wrote: > I want to call this procedure 'DBMS_AQ.ENQUEUE', but it requires a parameter > with type `DBMS_AQ.DEQUEUE_OPTIONS_T', how can i construct this data in > python? > Best regards. > > -- > http://www.yi-programmer.com/blog/ > > ------------------------------------------------------------------------------ > 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. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: yi h. <yi....@gm...> - 2011-10-17 03:30:58
|
I want to call this procedure 'DBMS_AQ.ENQUEUE', but it requires a parameter with type `DBMS_AQ.DEQUEUE_OPTIONS_T', how can i construct this data in python? Best regards. -- http://www.yi-programmer.com/blog/ |
From: Wong W. Meng-R. <r3...@fr...> - 2011-10-13 11:42:16
|
Hi Anthony, Yes I realized now that the SQL update actually failed, as now cx_Oracle doesn't return the number of row affected from INSERT/UDPATE/DELETE compared to oracledb so I overlooked it. Today I printout the cursor.rowcount to confirm that. It is true what you were saying. Yeah so likely this could be the rootcause and not that my API doesn't use the same connection object throughout like it did in the same framework using Queue and condition stuffs for mutex control in a multi-threaded environment. My application utilizes parameters in sequence object a lot in cursor.execution(). The order of the parameters and values is different in cx_Oracle as compared to oracledb so many API failed. So I am planning to write a parser or wrapper to handle this instead of letting the application team to modify at their API level, hiding this difference to lessen the efforts in migrations from python 1.5.2 to 2.7.1. Thanks for your reply and I will revert to this one more time when I have confirmed the threading mechanism from my old RMI architecture still works correctly, after experimenting it a working API. Regards, Wah Meng -----Original Message----- From: Anthony Tuininga [mailto:ant...@gm...] Sent: Thursday, October 13, 2011 11:51 AM To: cx-...@li... Subject: Re: [cx-oracle-users] cursor.execute() then conn.commit however SQL update not committed in database Hi, Check how many rows were updated by looking at cursor.rowcount. At a guess you are using a CHAR column instead of a VARCHAR2 column and they behave differently. :-) Anthony On Sun, Oct 9, 2011 at 5:42 AM, Wong Wah Meng-R32813 <r3...@fr...> wrote: > Hello there, > > > > I continue to work on my application migration from python 1.5.2 to 2.7.1, > from using oracledb to cx_Oracle in a python RMI framework. > > > > I am troubleshooting this issue whereby my API is updating userLastName of a > given userId. I am doing cursor.execute("update..") first then > connection.commit(). However, the data in the database doesn't seem changed, > which means the "commit" did not get through. There is no error generated > when ".commit()" is executed though. > > > > I am thinking my API might be using different connection objects to do the > cursor.execute() and connection.commit(), respectively however the > likelihood is low, as the old code using oracledb was working well. > > > > Does anyone has any idea how this can happen? > > > > > > Source code... > > > > def _processDB( self, conn_type, conn, cursor, db_type, db_msg ): > > """Internal method to execute the database transaction given.""" > > > > reply_error = None > > try: > > print ">>>> _processDB : conn_type=%s, db_type=%s, > db_msg=%s"%(conn_type, db_type, db_msg) > > if db_type == STMT_EXEC: > > msg, arg = db_msg > > if arg: > > reply_value = cursor.execute( msg, arg ) > > else: > > reply_value = cursor.execute( msg ) > > if reply_value == None: # none-select statement > > if conn_type == GENERAL_CONN: > > conn.commit() > > else: > > reply_value = cursor.fetchall() > > > > elif db_type == STMT_EXECL: > > msg, arg = db_msg > > if arg: > > reply_value = cursor.execute( msg, arg ) > > else: > > reply_value = cursor.execute( msg ) > > if reply_value == None: # select statement > > reply_value = cursor.fetchall() > > # get description > > desc_list = cursor.description > > desc = [] > > for i in desc_list: > > desc.append( i[0] ) > > reply_value.insert( 0, tuple(desc) ) > > else: > > if conn_type == GENERAL_CONN: > > conn.commit() > > > > elif db_type == STMT_PROC: > > reply_value = conn.callproc( db_msg ) > > > > elif db_type == STMT_COMMIT: > > print "Hello world" > > reply_value = conn.commit() > > > > elif db_type == STMT_ROLLBACK: > > reply_value = conn.rollback() > > > > > > print ">>>> _processDB : reply_value = %s"%(reply_value,) > > > > > > Debug Printout > > > >>>>> _processDB : conn_type=1, db_type=exec, db_msg=('select sysdate from >>>>> sys.dual', ()) > >>>>> _processDB : reply_value = [(datetime.datetime(2011, 10, 9, 19, 25, >>>>> 39),)] > >>>>> _processDB : conn_type=1, db_type=exec, db_msg=("select 1 from USERS >>>>> where USER_ID = 'ftcs' and ROWNUM = 1", ()) > >>>>> _processDB : reply_value = [(1,)] > >>>>> _processDB : conn_type=1, db_type=exec, db_msg=('update USERS set >>>>> USER_MODIFY_USER = :2, USER_MODIFY_DATE = :3, USER_FIRST_NAME = :4 where >>>>> USER_ID = :1', ['ftcs', 'ftcs', datetime.datetime(2011, 10, 9, 19, 25, 39), >>>>> 'Steven II']) > >>>>> _processDB : reply_value = None > >>>>> _processDB : conn_type=1, db_type=commit, db_msg=commit > > Hello world > >>>>> _processDB : reply_value = None > > > > > > Regards, > > Wah Meng > > Genesis Wafermap Support Ticket: > > To report a problem: > http://dyno.freescale.net/Question/QuestionMain3.asp?location=zmy02&category=&tickettype=6820 > > To request a service: > http://dyno.freescale.net/Question/Questionmain3.asp?location=74&category=2&tickettype=6819 > > Or if it is related to EWM or DSA: > http://dyno.freescale.net/Question/Questionmain3.asp?location=ZMY02&tickettype=6539 > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of 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-d2dcopy2 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > ------------------------------------------------------------------------------ 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. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Wong W. Meng-R. <r3...@fr...> - 2011-10-13 07:04:10
|
Wow, you are right. In that manner my existing codes where I replicate the use of the same value also will not work as the number of parameter requiring value and the number of element in the sequence must be tally now. My team is migrating application from python 1.5.2 to python 2.7.1, from oracledb to cx_Oracle, looks like this requires a big effort to revamp the coding. Anyway, thanks a lot for pointing out the root cause of my issue. :) Regards, Wah Meng ________________________________ From: Chris Gould [mailto:chr...@to...] Sent: Thursday, October 13, 2011 2:05 PM To: cx-...@li... Subject: Re: [cx-oracle-users] Invalid Number error when updating a NUMBER field using parameter subsitition I'd suggest it's because the association of bind-variable to value in the array is done positionally, not numerically. That is, in your statement the first bind variable encountered in the statement is :2, so that's associated with the first value in the array ('ftcs'). Hence the problem. On 13 October 2011 06:42, Wong Wah Meng-R32813 <r3...@fr...<mailto:r3...@fr...>> wrote: Hello guys, Can anyone advise why am I hitting invalid number error when trying to update a NUMBER field using parameters? The first SQL update works, however, not the second one. Is there a different way I need to pass to cx_Oracle if the parameter were a NUMBER field? SQL 1 (successful) >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = 1 where USER_ID = 'ftcs'") SQL 2 (failed) >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = :2 where USER_ID = :1", ('ftcs', 1)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/EComponent.py", line 821, in __call__ self._method, args, kw ) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1779, in _genericInvocation reply = self._requestReply( replyBit, (method_name, args, kw) ) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1612, in _requestReply reply = self._postReceive(reply) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1748, in _postReceive raise ValueError(post_msg[1]) # raise application-level exception ValueError: ORA-01722: invalid number USER_LAST_PW4_CHANGE DATE USER_OLD_PW5 VARCHAR2(30) USER_LAST_PW5_CHANGE DATE USER_LOGIN_FAILURE_ATTEMPT NUMBER REASON VARCHAR2(64) USER_LOGIN_FAILURE_REASON VARCHAR2(64) USER_LAST_LOGIN_DATE DATE USER_HR_DEPT VARCHAR2(10) Regards, Wah Meng ------------------------------------------------------------------------------ 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. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct _______________________________________________ cx-oracle-users mailing list cx-...@li...<mailto:cx-...@li...> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Chris G. <chr...@to...> - 2011-10-13 06:05:11
|
I'd suggest it's because the association of bind-variable to value in the array is done positionally, not numerically. That is, in your statement the first bind variable encountered in the statement is :2, so that's associated with the first value in the array ('ftcs'). Hence the problem. On 13 October 2011 06:42, Wong Wah Meng-R32813 <r3...@fr...> wrote: > Hello guys,**** > > ** ** > > Can anyone advise why am I hitting invalid number error when trying to > update a NUMBER field using parameters? **** > > ** ** > > The first SQL update works, however, not the second one. Is there a > different way I need to pass to cx_Oracle if the parameter were a NUMBER > field?**** > > ** ** > > ** ** > > SQL 1 (successful)**** > > >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = 1 where > USER_ID = 'ftcs'")**** > > ** ** > > SQL 2 (failed)**** > > >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = :2 where > USER_ID = :1", ('ftcs', 1))**** > > Traceback (most recent call last):**** > > File "<stdin>", line 1, in <module>**** > > File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/EComponent.py", line > 821, in __call__**** > > self._method, args, kw )**** > > File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1779, in > _genericInvocation**** > > reply = self._requestReply( replyBit, (method_name, args, kw) )**** > > File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1612, in > _requestReply**** > > reply = self._postReceive(reply)**** > > File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1748, in > _postReceive**** > > raise ValueError(post_msg[1]) # raise application-level exception**** > > ValueError: ORA-01722: invalid number**** > > ** ** > > ** ** > > USER_LAST_PW4_CHANGE DATE**** > > USER_OLD_PW5 VARCHAR2(30)**** > > USER_LAST_PW5_CHANGE DATE**** > > USER_LOGIN_FAILURE_ATTEMPT NUMBER**** > > REASON VARCHAR2(64)**** > > USER_LOGIN_FAILURE_REASON VARCHAR2(64)**** > > USER_LAST_LOGIN_DATE DATE**** > > USER_HR_DEPT VARCHAR2(10)**** > > ** ** > > Regards,**** > > Wah Meng**** > > ** ** > > > ------------------------------------------------------------------------------ > 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. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Wong W. Meng-R. <r3...@fr...> - 2011-10-13 06:03:56
|
I was thinking maybe the numeric value was passed in as string so I cast it to integer just to be assured. However, it still gives me the same error. >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = :2 where USER_ID = :1", ('ftcs', int(1))) Traceback (most recent call last): File "<stdin>", line 1, in <module> cx_Oracle.DatabaseError: ORA-01722: invalid number Regards, Wah Meng ________________________________ From: Wong Wah Meng-R32813 Sent: Thursday, October 13, 2011 1:43 PM To: 'cx-...@li...' Subject: Invalid Number error when updating a NUMBER field using parameter subsitition Hello guys, Can anyone advise why am I hitting invalid number error when trying to update a NUMBER field using parameters? The first SQL update works, however, not the second one. Is there a different way I need to pass to cx_Oracle if the parameter were a NUMBER field? SQL 1 (successful) >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = 1 where USER_ID = 'ftcs'") SQL 2 (failed) >>> a.execute("update USERS set USER_LOGIN_FAILURE_ATTEMPT = :2 where USER_ID = :1", ('ftcs', 1)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/EComponent.py", line 821, in __call__ self._method, args, kw ) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1779, in _genericInvocation reply = self._requestReply( replyBit, (method_name, args, kw) ) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1612, in _requestReply reply = self._postReceive(reply) File "/home/r32813/genesis/GEN_DEV_271/Product/Lib/RMI.py", line 1748, in _postReceive raise ValueError(post_msg[1]) # raise application-level exception ValueError: ORA-01722: invalid number USER_LAST_PW4_CHANGE DATE USER_OLD_PW5 VARCHAR2(30) USER_LAST_PW5_CHANGE DATE USER_LOGIN_FAILURE_ATTEMPT NUMBER REASON VARCHAR2(64) USER_LOGIN_FAILURE_REASON VARCHAR2(64) USER_LAST_LOGIN_DATE DATE USER_HR_DEPT VARCHAR2(10) Regards, Wah Meng |