cx-oracle-users Mailing List for cx_Oracle (Page 55)
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: Robert <web...@gm...> - 2010-06-09 04:30:20
|
Can I reuse a cursor ? say I have 3 SQLs: some_sql1 some_sql2 some_sql3 Is it rigt to do this, for each SQL ? dev_cursor = db.cursor() dev_cursor.execute(some_sql1) result_set = dev_cursor.fetchall() --do something w/ result_set thanks |
From: Robert <web...@gm...> - 2010-06-08 22:22:06
|
thanks I meant from within Python, I have called "curs.description" but the type is a type object and I wonder how tyo get the string value of the type On Tue, Jun 8, 2010 at 5:10 PM, Mark Harrison <mh...@pi...> wrote: > On 6/8/10 2:03 PM, Robert wrote: >> hi what's the "proper" way to check when column is NUMBER or STRING ? > > you can look in the data dictionary: > > select data_type from user_tab_cols where table_name='FOO' and column_name='BAR' > > > > or if you have just executed a query, look at the cursor.description: > > >>> curs.execute("select 99,'asdf' from dual") > <__builtin__.OracleCursor on <cx_Oracle.Connection to mh@templar>> > >>> curs.description > [('99', <type 'cx_Oracle.NUMBER'>, 127, 22, 0, 0, 1), ("'ASDF'", <type 'cx_Oracle.FIXED_CHAR'>, 32, 32, 0, 0, 1)] > > |
From: Mark H. <mh...@pi...> - 2010-06-08 21:44:33
|
On 6/8/10 2:03 PM, Robert wrote: > hi what's the "proper" way to check when column is NUMBER or STRING ? you can look in the data dictionary: select data_type from user_tab_cols where table_name='FOO' and column_name='BAR' or if you have just executed a query, look at the cursor.description: >>> curs.execute("select 99,'asdf' from dual") <__builtin__.OracleCursor on <cx_Oracle.Connection to mh@templar>> >>> curs.description [('99', <type 'cx_Oracle.NUMBER'>, 127, 22, 0, 0, 1), ("'ASDF'", <type 'cx_Oracle.FIXED_CHAR'>, 32, 32, 0, 0, 1)] HTH! Mark |
From: Robert <web...@gm...> - 2010-06-08 21:04:04
|
hi what's the "proper" way to check when column is NUMBER or STRING ? |
From: Hancock, D. (DHANCOCK) <DHA...@ar...> - 2010-06-07 21:44:39
|
I have used cx_OracleTools (with a DumpCSV tool included). http://cx-oracletools.sourceforge.net/README.txt Caveat: What follows is based on a version from 2006, maybe earlier. DumpCSV was great except that it wouldn't escape columns that contained commas. There are a bunch of slick tools in cx_OracleTools, but we now do as Waldemar shows below. Cheers! -- David Hancock | dha...@ar... -----Original Message----- From: Waldemar Osuch [mailto:wal...@gm...] Sent: Monday, June 07, 2010 5:26 PM To: cx-...@li... Subject: Re: [cx-oracle-users] Output to Excel/CSV On Mon, Jun 7, 2010 at 15:17, Robert <web...@gm...> wrote: > Hi new to Python here, > I have got cx_Oracle installed and verified its working. > > Does anyone have working code that : > > 1) runs a SQL via cx_Oracle and > 2) writes the result to Excel/CSV file > > thanks > Robert Here is a pattern I use quite often 8<------------------------------------------------- import csv import cx_Oracle as dbi conn = dbi.connect('user/password@dbname') cur = conn.cursor() cur.execute('select * from tbl_name') with open('tbl_name.csv', 'wb') as fp: w = csv.writer(fp) w.writerow([d[0] for d in cur.description]) for row in cur: w.writerow(row) |
From: Waldemar O. <wal...@gm...> - 2010-06-07 21:26:32
|
On Mon, Jun 7, 2010 at 15:17, Robert <web...@gm...> wrote: > Hi new to Python here, > I have got cx_Oracle installed and verified its working. > > Does anyone have working code that : > > 1) runs a SQL via cx_Oracle and > 2) writes the result to Excel/CSV file > > thanks > Robert Here is a pattern I use quite often 8<------------------------------------------------- import csv import cx_Oracle as dbi conn = dbi.connect('user/password@dbname') cur = conn.cursor() cur.execute('select * from tbl_name') with open('tbl_name.csv', 'wb') as fp: w = csv.writer(fp) w.writerow([d[0] for d in cur.description]) for row in cur: w.writerow(row) |
From: Robert <web...@gm...> - 2010-06-07 21:17:49
|
Hi new to Python here, I have got cx_Oracle installed and verified its working. Does anyone have working code that : 1) runs a SQL via cx_Oracle and 2) writes the result to Excel/CSV file thanks Robert |
From: Amaury F. d'A. <ama...@gm...> - 2010-05-31 15:33:22
|
Hi, 2010/5/31 Gerardo Berbeglia <gbe...@gm...>: > Hello, i have just installed cx_Oracle (in windows) and the following > error appears when python wants to import the library cx_Oracle: > > File "C:\Python26\cx_Oracle-doc\samples\examples\test.py", line 1, in > <module> import cx_Oracle > ImportError: DLL load failed: The specified module could not be found. > > I hope someone can help me with this. Thanks in advance! > > source code: > import cx_Oracle > print "hola" You must have an Oracle Client software installed on your machine, and the PATH environment variable must contain its "bin" subdirectory. -- Amaury Forgeot d'Arc |
From: Gerardo B. <gbe...@gm...> - 2010-05-31 15:16:08
|
Hello, i have just installed cx_Oracle (in windows) and the following error appears when python wants to import the library cx_Oracle: File "C:\Python26\cx_Oracle-doc\samples\examples\test.py", line 1, in <module> import cx_Oracle ImportError: DLL load failed: The specified module could not be found. I hope someone can help me with this. Thanks in advance! source code: import cx_Oracle print "hola" |
From: Anthony T. <ant...@gm...> - 2010-05-27 20:37:29
|
You're welcome. Thanks for letting me know. Anthony On Thu, May 27, 2010 at 12:21 PM, Tim Ferrell <IT...@mc...> wrote: > > Yes, that worked for me :-) Thanks much Anthony! > > > Anthony Tuininga <anthony.tuininga@...> writes: > >> >> Ah yes, this is what happens when you don't have access to Oracle 9i >> any longer.... >> >> I have checked in a change to trunk that I believe should resolve the >> issue. Can you test that for me and report back? Thanks. >> >> Anthony > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Tim F. <IT...@mc...> - 2010-05-27 18:22:04
|
Yes, that worked for me :-) Thanks much Anthony! Anthony Tuininga <anthony.tuininga@...> writes: > > Ah yes, this is what happens when you don't have access to Oracle 9i > any longer.... > > I have checked in a change to trunk that I believe should resolve the > issue. Can you test that for me and report back? Thanks. > > Anthony |
From: Tamás G. <gt...@gt...> - 2010-05-27 12:40:45
|
What about an ugly Oracle workaround: create writable view over the "spots" table WITHOUT the column you're wanting to be NULL. > Message: 4 > Date: Tue, 18 May 2010 13:20:11 +0200 > From: Tobias Sauerwein <tob...@ca...> > Subject: [cx-oracle-users] Inserting 'None' values > To: cx-...@li... > Message-ID: > <AAN...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, > > I am trying to use a Python 'None' value as bind parameter for a > geometry column in an insert statement, but this does not work: > >>>> cursor.executemany('insert into spots values(:id, :height, :geom)', [{'id': 14, 'height': 2, 'geom': None}]) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected > MDSYS.SDO_GEOMETRY got CHAR > >>>> cursor.executemany('insert into spots values(:id, :height, NULL)', [{'id': 14, 'height': 2}]) >>>> > > > I don't know what query is actually sent to the database, but it seems > as if 'None' is not converted to 'NULL'. And using 'None' as bind > parameter for the decimal column 'height' works. > > Is this a bug? > > Thanks, > Tobias > > > > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > End of cx-oracle-users Digest, Vol 47, Issue 4 > ********************************************** > |
From: Anthony T. <ant...@gm...> - 2010-05-26 21:28:38
|
Ah yes, this is what happens when you don't have access to Oracle 9i any longer.... :-) I have checked in a change to trunk that I believe should resolve the issue. Can you test that for me and report back? Thanks. Anthony On Wed, May 26, 2010 at 2:21 PM, Tim Ferrell <IT...@mc...> wrote: > > I am trying to build cx_Oracle 5.0.3 against Oracle 9.2.0.8 on Ubuntu Linux > 10.04 x64 and am getting the following error. Any ideas? FWIW I was able to > compile the ruby_oci8 gem against this install ... I know that is apples and > oranges, but I'm just saying the oracle install works ;-) > > Any help appreciated! > > Cheers, > Tim > > > running build > running build_ext > building 'cx_Oracle' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict- > prototypes -fPIC -I/opt/oracle/product/9.2.0/rdbms/demo - > I/opt/oracle/product/9.2.0/rdbms/public -I/usr/include/python2.6 -c cx_Oracle.c > -o build/temp.linux-x86_64-2.6-9i/cx_Oracle.o -DBUILD_VERSION=5.0.3 > In file included from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2152, > from cx_Oracle.c:10: > /opt/oracle/product/9.2.0/rdbms/demo/oci1.h:148: warning: function declaration > isn’t a prototype > In file included from /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:193, > from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2177, > from cx_Oracle.c:10: > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:667: warning: function declaration > isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2655: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2664: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2674: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2683: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2692: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2701: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2709: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2719: warning: function > declaration isn’t a prototype > In file included from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2177, > from cx_Oracle.c:10: > /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:6897: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:9801: warning: function > declaration isn’t a prototype > /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:9807: warning: function > declaration isn’t a prototype > In file included from SessionPool.c:139, > from cx_Oracle.c:167: > Connection.c:149: error: ‘Connection_SetOCIAttr’ undeclared here (not in a > function) > error: command 'gcc' failed with exit status 1 > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Tim F. <IT...@mc...> - 2010-05-26 20:25:19
|
I am trying to build cx_Oracle 5.0.3 against Oracle 9.2.0.8 on Ubuntu Linux 10.04 x64 and am getting the following error. Any ideas? FWIW I was able to compile the ruby_oci8 gem against this install ... I know that is apples and oranges, but I'm just saying the oracle install works ;-) Any help appreciated! Cheers, Tim running build running build_ext building 'cx_Oracle' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict- prototypes -fPIC -I/opt/oracle/product/9.2.0/rdbms/demo - I/opt/oracle/product/9.2.0/rdbms/public -I/usr/include/python2.6 -c cx_Oracle.c -o build/temp.linux-x86_64-2.6-9i/cx_Oracle.o -DBUILD_VERSION=5.0.3 In file included from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2152, from cx_Oracle.c:10: /opt/oracle/product/9.2.0/rdbms/demo/oci1.h:148: warning: function declaration isn’t a prototype In file included from /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:193, from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2177, from cx_Oracle.c:10: /opt/oracle/product/9.2.0/rdbms/public/nzt.h:667: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2655: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2664: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2674: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2683: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2692: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2701: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2709: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/public/nzt.h:2719: warning: function declaration isn’t a prototype In file included from /opt/oracle/product/9.2.0/rdbms/demo/oci.h:2177, from cx_Oracle.c:10: /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:6897: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:9801: warning: function declaration isn’t a prototype /opt/oracle/product/9.2.0/rdbms/demo/ociap.h:9807: warning: function declaration isn’t a prototype In file included from SessionPool.c:139, from cx_Oracle.c:167: Connection.c:149: error: ‘Connection_SetOCIAttr’ undeclared here (not in a function) error: command 'gcc' failed with exit status 1 |
From: Jani T. <re...@gm...> - 2010-05-19 11:46:36
|
For Django ORM there was special hack to to overcome problems with that. I recall that it puts "NULL" as a string to that part of insert/update query if value for geom field was None. But truth is that as long as cx_Oracle doesn't support well underlying oracle objects it's pretty hard to get things working simple. > Thanks for your reply, Jani. > > This is too bad, because I am using cx_Oracle through SQLAlchemy and > SQLAlchemy uses all columns in an insert statement. > > The problem is that cx_Oracle does not know the type for the column > for which I want to insert a NULL value? Would it work if I pass > something like 'cx_Oracle.OBJECT.NoneObject' or > 'cx_Oracle.OBJECT.NoneObject('MDSYS.SDO_GEOMETRY')' to cx_Oracle? > > > > Hi, > > > > > > I am trying to use a Python 'None' value as bind parameter for a > > > > > > geometry column in an insert statement, but this does not work: > > > >>> cursor.executemany('insert into spots values(:id, :height, :geom)', > > > >>> [{'id': 14, 'height': 2, 'geom': None}]) > > > > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected > > > MDSYS.SDO_GEOMETRY got CHAR > > > > > > >>> cursor.executemany('insert into spots values(:id, :height, NULL)', > > > >>> [{'id': 14, 'height': 2}]) > > > > > > I don't know what query is actually sent to the database, but it seems > > > as if 'None' is not converted to 'NULL'. And using 'None' as bind > > > parameter for the decimal column 'height' works. > > > > > > Is this a bug? > > > > Expected behaviour, see > > http://sourceforge.net/mailarchive/message.php?msg_name=49F050EC.30205%40 > > gmail.com > > > > for further information. > > > > -- > > > > Jani Tiainen > > --------------------------------------------------------------------------- > --- > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Tobias S. <tob...@ca...> - 2010-05-19 06:40:11
|
Thanks for your reply, Jani. This is too bad, because I am using cx_Oracle through SQLAlchemy and SQLAlchemy uses all columns in an insert statement. The problem is that cx_Oracle does not know the type for the column for which I want to insert a NULL value? Would it work if I pass something like 'cx_Oracle.OBJECT.NoneObject' or 'cx_Oracle.OBJECT.NoneObject('MDSYS.SDO_GEOMETRY')' to cx_Oracle? > > Hi, > > > > I am trying to use a Python 'None' value as bind parameter for a > > > > geometry column in an insert statement, but this does not work: > > >>> cursor.executemany('insert into spots values(:id, :height, :geom)', > > >>> [{'id': 14, 'height': 2, 'geom': None}]) > > > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected > > MDSYS.SDO_GEOMETRY got CHAR > > > > >>> cursor.executemany('insert into spots values(:id, :height, NULL)', > > >>> [{'id': 14, 'height': 2}]) > > > > I don't know what query is actually sent to the database, but it seems > > as if 'None' is not converted to 'NULL'. And using 'None' as bind > > parameter for the decimal column 'height' works. > > > > Is this a bug? > > Expected behaviour, see > http://sourceforge.net/mailarchive/message.php?msg_name=49F050EC.30205%40gmail.com > > for further information. > > -- > > Jani Tiainen |
From: Jani T. <re...@gm...> - 2010-05-18 13:37:37
|
> Hi, > > I am trying to use a Python 'None' value as bind parameter for a > > geometry column in an insert statement, but this does not work: > >>> cursor.executemany('insert into spots values(:id, :height, :geom)', > >>> [{'id': 14, 'height': 2, 'geom': None}]) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected > MDSYS.SDO_GEOMETRY got CHAR > > >>> cursor.executemany('insert into spots values(:id, :height, NULL)', > >>> [{'id': 14, 'height': 2}]) > > I don't know what query is actually sent to the database, but it seems > as if 'None' is not converted to 'NULL'. And using 'None' as bind > parameter for the decimal column 'height' works. > > Is this a bug? Expected behaviour, see http://sourceforge.net/mailarchive/message.php?msg_name=49F050EC.30205%40gmail.com for further information. -- Jani Tiainen |
From: Tobias S. <tob...@ca...> - 2010-05-18 11:20:21
|
Hi, I am trying to use a Python 'None' value as bind parameter for a geometry column in an insert statement, but this does not work: >>> cursor.executemany('insert into spots values(:id, :height, :geom)', [{'id': 14, 'height': 2, 'geom': None}]) Traceback (most recent call last): File "<stdin>", line 1, in <module> cx_Oracle.DatabaseError: ORA-00932: inconsistent datatypes: expected MDSYS.SDO_GEOMETRY got CHAR >>> cursor.executemany('insert into spots values(:id, :height, NULL)', [{'id': 14, 'height': 2}]) >>> I don't know what query is actually sent to the database, but it seems as if 'None' is not converted to 'NULL'. And using 'None' as bind parameter for the decimal column 'height' works. Is this a bug? Thanks, Tobias |
From: VJ K. <vj...@gm...> - 2010-05-12 14:04:28
|
Anthony Tuininga <anthony.tuininga@...> writes: > > need to split it like that. Then again, how did it get there in the > first place? Perhaps it can be chunked from the original source? Yes, it can be done. > If I made the use of OCILobWrite2 possible, would > you be able to do some testing for me? I can't see that I am going to > be able to write larger than 2 GB data particularly easily at this > time. I can test, no problem there. > |
From: Anthony T. <ant...@gm...> - 2010-05-12 13:41:09
|
On Tue, May 11, 2010 at 3:36 PM, VJ Kumar <vj...@gm...> wrote: > Anthony Tuininga <anthony.tuininga@...> writes: > >> >> On Tue, May 11, 2010 at 2:18 PM, VJ Kumar <vjkmail@...> wrote: >> > Anthony Tuininga <anthony.tuininga@...> writes: >> > >> >> >> >> Hmm, just a question: why would you want to write more than 2 GB at a >> >> time? Why not write it in chunks smaller than 2 GB? >> > >> > I would be happy to, but the write call does not have the offset >> > parameter as in: >> > >> > write(buffer, offset, length). Or does it ? >> >> It does indeed. Its even in the documentation.... >> >> write(data, offset = 1) >> > > Right you are ! I did see the parameter, but I wrote my previous remark > incorrectly: what I meant was that there is no 'length' parameter (rather than > no 'offset') that would allow writing chunks without copying to a smaller buffer. Right. Well, if you already have the data in memory there should be no need to split it like that. Then again, how did it get there in the first place? Perhaps it can be chunked from the original source? > By the way, OCI now has extended writes(OCILobWrite2) with 64 bit offsets and > lengths. Nice. I'll have to take a look at that and see if that will resolve the problem for you. If I made the use of OCILobWrite2 possible, would you be able to do some testing for me? I can't see that I am going to be able to write larger than 2 GB data particularly easily at this time. :-) Anthony |
From: Tobias S. <tob...@ca...> - 2010-05-12 06:16:29
|
Hi Anthony, thanks for your reply. Now at least I know why it is not working. Tobias |
From: VJ K. <vj...@gm...> - 2010-05-11 21:37:07
|
Anthony Tuininga <anthony.tuininga@...> writes: > > On Tue, May 11, 2010 at 2:18 PM, VJ Kumar <vjkmail@...> wrote: > > Anthony Tuininga <anthony.tuininga@...> writes: > > > >> > >> Hmm, just a question: why would you want to write more than 2 GB at a > >> time? Why not write it in chunks smaller than 2 GB? > > > > I would be happy to, but the write call does not have the offset > > parameter as in: > > > > write(buffer, offset, length). Or does it ? > > It does indeed. Its even in the documentation.... > > write(data, offset = 1) > Right you are ! I did see the parameter, but I wrote my previous remark incorrectly: what I meant was that there is no 'length' parameter (rather than no 'offset') that would allow writing chunks without copying to a smaller buffer. By the way, OCI now has extended writes(OCILobWrite2) with 64 bit offsets and lengths. VJ |
From: Anthony T. <ant...@gm...> - 2010-05-11 20:35:35
|
On Tue, May 11, 2010 at 2:18 PM, VJ Kumar <vj...@gm...> wrote: > Anthony Tuininga <anthony.tuininga@...> writes: > >> >> Hmm, just a question: why would you want to write more than 2 GB at a >> time? Why not write it in chunks smaller than 2 GB? > > I would be happy to, but the write call does not have the offset > parameter as in: > > write(buffer, offset, length). Or does it ? It does indeed. Its even in the documentation.... :-) write(data, offset = 1) is the signature. Anthony |
From: VJ K. <vj...@gm...> - 2010-05-11 20:19:03
|
Anthony Tuininga <anthony.tuininga@...> writes: > > Hmm, just a question: why would you want to write more than 2 GB at a > time? Why not write it in chunks smaller than 2 GB? I would be happy to, but the write call does not have the offset parameter as in: write(buffer, offset, length). Or does it ? Thanks. VJ |
From: Anthony T. <ant...@gm...> - 2010-05-11 14:08:13
|
Hi, You aren't doing anything wrong. Object support is not available in cx_Oracle at the moment. Its the top item at the moment -- but I've had very little time recently to even look at it so don't count on it anytime in the near future, unfortunately. Anthony On Tue, May 11, 2010 at 1:33 AM, Tobias Sauerwein <tob...@ca...> wrote: > Hi! > > I am trying to use an object of type cx_Oracle.OBJECT as query argument, but > I am receiving an error message. Is it not supported by cx_Oracle, or am I > doing something wrong? > > My code looks like this: > >>>> curs = conn.cursor() >>>> curs.execute("select sdo_geometry('POINT(0 0)', 4326) from dual") > <__builtin__.OracleCursor on <cx_Oracle.Connection to > system@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.101.131)(PORT=11432)))(CONNECT_DATA=(SID=gis)))>> >>>> obj = curs.fetchone()[0] >>>> obj > <cx_Oracle.OBJECT object at 0x8c9c320> >>>> curs2 = conn.cursor() >>>> curs2.execute("select sdo_util.to_wktgeometry(:arg) from dual", arg=obj) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type > cx_Oracle.OBJECT > > > Thanks, > Tobias > > ------------------------------------------------------------------------------ > > > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |