[cx-oracle-users] Antw: Re: Antw: Re: Problem with internal buffer sizes
Brought to you by:
atuining
From: matilda m. <ma...@gr...> - 2007-01-25 17:57:53
|
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. 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. 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 :-)) 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). 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! :-))) 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. :-) Best regards Andreas Mock |