|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: is there something like sth->fetchrow_hashref in sybperl
Date: Sep 24 2002 4:02PM
On Mon, 2002-09-23 at 14:59, loan tran wrote:
> 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.
The 1 is just the same as TRUE. Any non-0 value should work.
Michael
> --- 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
>
>
--
Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!
|