LanceDeeply has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Has anyone ever used the Win32::ODBC to process multiple result sets of different sizes? It doesnt seem to rebind the columns correctly for me.
$db->sql(" select starttime = getdate() select a=1, b=2 select endtime = getdate() " ); do { while ($db->FetchRow()) { my @columnNames = $db->FieldNames(); my @values = $db->Data(); print join "|", @columnNames; print "\n"; print join "|", @values; print "\n"; } } while $db->MoreResults();
yeilds:
starttime 2002-08-01 18:45:31.277 starttime 1 starttime 2002-08-01 18:45:31.277
But I was expecting:
starttime 2002-08-01 18:45:31.277 a b 1 2 endtime 2002-08-01 18:45:31.277
Thanks!

Replies are listed 'Best First'.
Re: having trouble w/ Win32::ODBC's MoreResults
by screamingeagle (Curate) on Aug 01, 2002 at 17:53 UTC
Re: having trouble w/ Win32::ODBC's MoreResults
by Cine (Friar) on Aug 01, 2002 at 18:36 UTC
    I dont that variant of sql. Shouldnt it have been something like:
    SELECT getdate() AS starttime; SELECT 1 AS a, 2 AS b; SELECT getdate() AS endtime;


    T I M T O W T D I