Re: [cx-oracle-users] type object matching - BINARY
Brought to you by:
atuining
From: M. A. W. <maw...@gm...> - 2006-09-13 12:48:54
|
this is the code i used to get values import cx_Oracle con = cx_Oracle.connect("user/userpassword@xe") cur = con.cursor() cur.execute("select * from tab") res = cur.fetchall() for rec in res: print rec[0] ,"--->", rec[1] Just a test Code On 9/13/06, Mario Frasca <mf...@zo...> wrote: > > I've a question about this behaviour: > > >>> cx_Oracle.BINARY == cx_Oracle.BINARY > True > >>> cx_Oracle.BINARY == cx_Oracle.LOB > False > >>> cx_Oracle.BINARY == cx_Oracle.BLOB > False > >>> cx_Oracle.BINARY == cx_Oracle.CLOB > False > > is it correct? after reading the pep-249 at > http://www.python.org/dev/peps/pep-0249/, I would expect all of them to > check True. otherwise, how do I check if a field is holding a binary > object in a db-api2 compatible way? > > I've checked pgdb and MySQLdb and only MySQLdb recognizes a binary > object as above. > > how to test: > > import cx_Oracle, open a connection, associate cr to a cursor. > > >>> cr.execute('create table test(pk_test integer not null primary key, > v_text clob)') > >>> cr.execute('select * from test') > [<cx_Oracle.NUMBER object at 0x40344ca0>, <cx_Oracle.CLOB object at > 0x40311bd0>] > >>> cr.description[1][1] > <type 'cx_Oracle.CLOB'> > >>> cr.description[1][1] == cx_Oracle.BINARY > False > >>> > > regards, > MF > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |