DBI cursor behaviour with multiple statements?

Henrik Weber Henrik.Weber at sys.aok.de
Fri Sep 27 05:37:25 EDT 2002


Hello,

I'm trying to write a DBI2 compliant module for Microsoft Access
databases. Now I'm not quite sure how to interpret the DBI2
specification when it comes to the execution of multiple data
returning statements with the same cursor.

For example if c is my cursor and I do:
c.executemany("SELECT * FROM table WHERE column = '%s'", [["parm1"],
["parm2"], ["parm3"]])

should the result be the union of all three statements or just the
result of the first or the last statement? Or should the user switch
from one resultset to the next with nextset?

And what if I execute another SELECT-statement before all results of
the previous execute or executemany have been fetched? Should the
cursor first return the rest of the previous statements results or
should the results of the last statement replace whatever there was
before?

Maybe someone reading this group can clarify those points for me.

Thanks,
Henrik Weber



More information about the Python-list mailing list