Asking for Help: How can I fetch a system-generated value from a database after inserting a row using the cursor.execute() function?

The API is described in PEP 249. Unfortunately, the return value of cursor.execute is not defined in the specification, however, but it may be the case that your database adapter may provide a meaningful return value. When issuing insert statements in SQL, sometimes the number of rows inserted may be returned (which is probably what you're referring to), but even in systems like PostgreSQL where this can be observed, there can be situations where a result of 0 is given instead of the actual number of inserted rows. I seem to recall that table partitions, for instance, don't (or didn't) support non-zero results from insert when statements were issued in the SQL client. -- PaulBoddie 2012-05-31 12:03:22

CategoryAskingForHelp CategoryAskingForHelpAnswered

Asking for Help/How can i fetch system generated value from database after inserting a row using cursor.execute() function? (last edited 2012-05-31 12:03:23 by PaulBoddie)

Unable to edit the page? See the FrontPage for instructions.