|
|
sybperl-l Archive
Up Prev Next
From: "Matt Groves" <mgr at micromuse dot com>
Subject: Re: is there something like sth->fetchrow_hashref in sybperl
Date: Sep 23 2002 9:44PM
Hello,
I think you want something like this :
$sql = qq(select name,id from a table) ;
while(%results = $dbh->dbnextrow(1))
{
$name = $results{name} ;
$id = $results{id} ;
print "name is ".$name." and id is ".$id."\n" ;
}
Off the top of my head, it's late in the uk....
Matt.
----- Original Message -----
From: "loan tran"
To: "SybPerl Discussion List"
Sent: Monday, September 23, 2002 7:34 PM
Subject: is there something like sth->fetchrow_hashref in sybperl
> Howdy,
> I'm looking for a function in sybperl(use
> Sybase::DBlib) which does the same like this in
> DBI(use DBI):
>
> $sql = qq(select name,id from atable);
> while($data = $sth->fetchrow_hashref){
> print "name: $data{name}\n
> id : $data{id}";
> }
> Your help is greatly appriciated.
>
> Loan
>
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
>
>
|