[DB-SIG] Clarification of cursor.arraysize

Art Protin aprotin at research.att.com
Mon Dec 18 22:56:28 CET 2006

Dear folks,
    I find yet again that I am confused by what I read in pep-0249.  
This time it is the last line describing the attribute of cursor objects 
named .arraysize (I quote here both paragraphs):

    This read/write attribute specifies the number of rows to
    fetch at a time with fetchmany().  It defaults to 1 meaning
    to fetch a single row at a time.

    Implementations must observe this value with respect to
    the fetchmany() method, but are free to interact with the
    database a single row at a time.  It may also be used in
    the implementation of executemany().

I fail to grasp how .arraysize could have any bearing on .executemany() 
or for that matter any operation other than fetchmany().  Thus I find I 
must request aid in understanding what the intent is here - HELP,  please.

      While I am bothering you good people with my silly questions, I 
might just as well tack on another:  if one invokes .executemany with a 
seq_of_parameters that is empty (like

a_cursor.executemany(SQL, [])

) shouldn't the interface module execute the query zero times, ie, not 
execute the query at all?
I think that is what I am going to do but I would like to hear your 
comments either way.

          Thank you all,
            Arthur Protin

More information about the DB-SIG mailing list