|
|
sybperl-l Archive
Up Prev Next
From: loan tran <loan_tr at yahoo dot com>
Subject: Re: is there something like sth->fetchrow_hashref in sybperl
Date: Sep 23 2002 9:59PM
Thanks very much Matt.
You've given me exactly what i'm looking for.
Good night!
PS: when you have a chance, could you explain what is
1 for. ($dbh->dbnextrow(1)). Thanks.
Loan
--- Matt Groves wrote:
>
> 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
> >
> >
>
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
|