[DB-SIG] Something funny
Mon, 17 Jul 2000 00:49:14 -0700
I am using OLD Oracle module (it header says Copyright 1996 by Digital
I assume it might be outdated version of DCOracle or something :-)
Well, it works for me right, and I have patched it to meet my needs (ability
to create Python Oracle connection object from connection established by
SQL in C file - I use Python as embedded scripting language and in order to
things up I connect to Oracle only once - at program boot).
Anyhow, all this was just some background information.
My problem is following. In that Oracle module there is a method (for cursor
object) - execute() - yeah, you guessed - it is function which parses and
SQL statements ;). If statement is update/delete, it does return number of
affected. It is done by:
Where cur->cda.rpc is that needed number of rows (defined as 'unsigned
From Python I am executing statement like:
a= dbc.execute("update xxx set yyy='Mooo' where zzz=:1",('Meee',))
if a!=0: dbc.execute("insert into xxx values('Mooo',:1)",('Meee',))
The problem is that second statement NEVER executes in my example as
returns None, not the number!
In addition must say, that in stand-alone Python interpreter (without
this code into my C application it seems to work all right).
Also, I added some debug information to this Oracle module, and before
statement in execute() method return value IS number (checked it by printing
using Python functions)!!!
I am a bit confused, as I cannot think of what could possibly be wrong.
the problem is improperly linked binary file (I link Oracle module
python/libpython, and then link it statically to my executable).
Anyhow - any ideas are welcome.