Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

having trouble w/ Win32::ODBC's MoreResults

by LanceDeeply (Chaplain)
on Aug 01, 2002 at 17:50 UTC ( [id://186862]=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://186862]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found