more_results was "Having a code ref executed when result set is all fetched"

"Martin J. Evans" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization Easysoft Limited
Message-ID <[email protected]>
On 15/03/12 12:35, Tim Bunce wrote:

> There's actually an (almost completely undocumented) more_results()
> method that's meant for that kind of thing. I was rather surprised
> to find it wasn't documented as I'm pretty sure we thrashed out the
> semantics some time ago.
>
> [later] Wow, "some time ago" was 2004 :)
> See http://markmail.org/thread/i7drouwtpdiybjzn#query:+page:1+mid:p4dy4uv3t2kpku56+state:results
> The "example implementation" in there assumed $sth->prepare works.
> Given current realities the more_results method would be like:
>      $sth = $sth->{Database}->prepare($sql);
>      $sth->execute;
>      return $sth; # caller must use this returned handle

That thread was actually a lot longer than markmail shows:

http://www.nntp.perl.org/group/perl.dbi.dev/2004/02/msg3062.html
http://www.nntp.perl.org/group/perl.dbi.dev/2004/03/msg3221.html

Various drivers now have their own implementation:

syb_more_results:
http://search.cpan.org/~mewp/DBD-Sybase-1.14/Sybase.pm#Handling_Multiple_Result_Sets

odbc_more_results:
http://search.cpan.org/~mjevans/DBD-ODBC-1.35/ODBC.pm#odbc_more_results

sqlite_allow_multiple_statements:
http://search.cpan.org/~adamk/DBD-SQLite-1.35/lib/DBD/SQLite.pm#Processing_Multiple_Statements_At_A_Time

more_results:
http://search.cpan.org/~capttofu/DBD-mysql-4.020/lib/DBD/mysql.pm#MULTIPLE_RESULT_SETS

teradata also has tdat_more_results

There are probably more, these are just the ones I've used.

My recollection is that the discussion found that handling multiple result sets was more complicated than some people first thought and I guess that is why it never really came to fruition. In particular:

http://www.nntp.perl.org/group/perl.dbi.dev/2004/03/msg3243.html

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.