Why can't use cursor.nextset() in adodbapi package?

Tim Roberts timr at probo.com
Tue Jan 25 03:23:39 EST 2005


nightmarch <nightmarch at gmail.com> wrote:

>Thank you Dennis!
>
>You mean I should execute many select statement like this " rec =
>crsr.fetchall() " ?

No, you misunderstand.  nextset() is used when you issue several SELECT
statements in a single request.  The first fetchall() gets the results of
the first SELECT statement.  To get the next one, you use nextset().

Your example only had one SELECT:

>> > >>> sql = "select * from wjtmp"
>> > >>> crsr.execute(sql)
>> > >>> rec = crsr.fetchone()
>> > >>> crsr.nextset()

If you are only issuing one SELECT, like most applications, then nextset()
serves no purpose.  If you did something like this:

  sql = "select * from wjtmp; select count(*) from wjtmp;"

That's when you need nextset().  Personally, I've never used it.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list