Re: [cx-oracle-users] type object matching - BINARY
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-09-13 17:33:13
|
The PEP is very vague on the types and their handling. It specifies only BINARY and then proceeds to indicate that LONG (long strings in Oracle) should be based on this as well?? That doesn't make any sense at all. Note that CLOB would fall into "BINARY" as far as the PEP is concerned but as far as Oracle is concerned that makes no sense. I've taken the approach that the DB API PEP should be followed as much as possible -- except where following it would make the interface to Oracle difficult to follow/understand for anyone who understands Oracle. In addition, binary data is rarely used in databases so using setinputsizes() to specify the type directly works quite well and doesn't involve (IMHO) brain damage. :-) I'd be happy to suggest a change to the PEP that would work for other interfaces as well -- I know there are a number of interfaces that deal with input/output in a much more controlled fashion but none of this has gone into the PEP. I subscribe to the db-sig mailing list as well and there is significant resistance to make any changes at all. If you have any further suggestions I'd be happy to entertain them. I won't be adding anything along the lines of DBAPITypeObject() as it doesn't make any sense -- see above. If that is something you really care about you can always create your own Python wrapper.... :-) On 9/13/06, D.R. Boxhoorn <da...@as...> wrote: > > Hoi Mario, > > You are right, but I'm happy to leave the C implementation to Anthony. > Personally, I very much dislike the whole idea of using the equivalence > operator on types in the way suggested in the pep. For example > > BINARY =3D=3D CLOB > > To me BINARY and CLOB are not equivalent and never will be. > More natural would be > > issubclass(CLOB, BINARY) > > (Now you now what C and B in the help() for issubclass() stand for ;) > but even so, it's usually better to stay as far as possible from discussi= ons > on such matters. > > Cheers, > > Danny > > On Wed, Sep 13, 2006 at 05:41:30PM +0200, Mario Frasca wrote: > > Hi Danny, > > > > ... thinking a bit... but what you describe is what I would expect to > > find already in cx_Oracle... I expected BINARY to have been defined > > as DBAPITypeObject(cx_Oracle.BLOB, cx_Oracle.LOB, cx_Oracle.CLOB) (or > > something similar, maybe including LONG_STRING?)... I would even have = a > > look at the sources, but the Python/C bindings still scare me a bit awa= y. > > > > if there was a cx_Oracle.py source, I would have added the following > > line: > > > > BINARY =3D DBAPITypeObject(BLOB, LOB, CLOB) > > > > made some tests, submitted a patch. > > > > as I said, I'm a very bad educator... > > > > regards, > > Mario > > > > -- > > je vais m'envoyer une lettre de felicitation. > > Des felicitations, =E7a fait toujours plaisir, > > surtout de la part de quelqu'un qu'on aime bien. > > > > -----------------------------------------------------------------------= -- > > Using Tomcat but need to do more? Need to support web services, securit= y? > > 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 Geron= imo > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > ------------------------------------------------------------------------- > 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 ea= sier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |