More DBI question

Timothy Grant tjg at avalongroup.net
Tue Jan 18 19:42:38 EST 2000


Gordon McMillan wrote:
> > Howevever, the second time through this sequence, the first execute
> > returns an error along the lines of "Expecting 3 arguments received 1"
> >
> > Now I understand where the three arguments part comes from, the cursor
> > just did something that required three arguments, but how do I "reset"
> > what the cursor expects, it seems clunky to call a db.commit() after
> > each execute.
 
> As you might expect by now, much depends on what DB,
> what driver and what DBI implementation you're using. I
> suggest, however, closing a cursor once you're done with an
> execute and using a new cursor.

Thanks Gordon, I appreciate the input. I'm am now going through my code
and closing all cursors after I get the result table.

As I stop to think about it though, If I were to need to make a
different query mid-fetch(), I would then need to open a separate cursor
and use it. I'm significantly new enough to this type of DB programming
that I just don't know what is good style and what is not.

-- 
Stand Fast,
    tjg.

Chief Technology Officer              tjg at exceptionalminds.com
Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.                   (503) 246-3630
>>>>>>>>>>>>EXCEPTIONAL MINDS, INNOVATIVE PRODUCTS<<<<<<<<<<<<




More information about the Python-list mailing list