Re: [cx-oracle-users] Antw: Re: Antw: Re: Problem with internal buffer sizes
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2007-01-25 22:19:00
|
On 1/25/07, matilda matilda <ma...@gr...> wrote: > Hi Anthony, > > >>> "Anthony Tuininga" <ant...@gm...> 25.01.07 17.12 Uhr > >>> > >I'm not sure what you mean by this. Could you explain further? > >Currently cx_Oracle expects you to have to deal with everything. You > >must pass in a stream of characters (not unicode) and you will get > >back the same. That should be changed -- once I get my head around > >everything, of course. :-) > > Ok, my conclusion until now: > 1) At the moment you can forget python unicode strings > and the direct handling of them concering binding them to > oracle table columns. Correct. > 2) At the moment the allocated buffers for defined variables > (db->client) and the buffer hint for the server side while > binding (client->db) is done in a simple 1-to-1-fashion. > That's ok, as long as the byte representation of a character > string has the same length as the characterstring itself. Correct. > 3) Problems arise as soon as the byte representation is > dfferent on both sides. > a) While defining and allocating a variable on the client side > (db->client) you should take care about the Attributes "isVariableSize" > and "MaxBytesPerChar" for byte buffer allocation. This could be done > quite soon, I think :-)) Yes, it can. > b) While binding a variable (update/insert-statment) code should care > about giving the server side a correct hint (better more than less) for > the size of the server side byte representation after converting the > incomming character stream to the byte representation of the > related database encoding. (This is a db attribute. Don't know if > there's > a similar OCI call to get somthing like MaxBytePerChar). This is uncertain as to whether or not this can be accomplished without access to a unicode string in Python. If you have suggestions as to which OCI calls to make, let me know. > c) Forget the assumption that the python byte string can be max of 4000 > bytes to fit into a varchar2(4000) column. It can be more if the client > side > representation is bigger than the db side representation. This can be > done > really now! :-))) Character semantics would allow for this. I'll have to see if this is going to cause a problem at all. > 4) Ask if I can help you. I really need the corrections and I hoped you > could > hit the right statements in your code much quicker than I can. Or I > start to > change your code and it will start to be an ugly mess of c > statements... > ...then you can forget your nice object oriented coding style. :-) I can make the changes and test them somewhat but I would be happy if you could test them more thorougly given your needs. If you're in a very big hurry feel quite free to make any changes to your local copy and then send me the patches (diffs). I can then integrate them without having to figure everything out myself. What is your pleasure? I think we should take this off the list now unless there is something from which all would benefit. A final message in this thread can be sent when the problems are resolved to your satisfaction. > Best regards > Andreas Mock > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |