|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: DB-Library samples
Date: Mar 6 2001 7:07PM
Warren Pollans writes:
> Hello,
>
> The sample code (for DB-Library) mentioned in the Programmers Supplement for
> Unix is not installed on our system. If it's not proprietary stuff, could
> someone please point to where it can be found on the net. I'm actually
> interested in sample (or real) sybperl code that is more detailed than those
> found in sybPerl docs - I'd like to do several selects in one query and am
> interested in the looping, testing, and ordering of calls to dbresults() and
> dbnextrow().
You can get the sample code in the linux download
(http://linux.sybase.com) (though you'll need rpm to extract the data,
unfortunately).
The short answer, however is this:
$dbh->dbcmd( ... long SQL statement with multiple selects... );
$dbh->dbsqlexec;
while($dbh->dbresults !=- NO_MORE_ROWS) { # loops once per result set
while(@d = $dbh->dbnextrow) {
... # once per row (duh!)
}
}
Michael
--
Michael Peppler - Data Migrations Inc. - mpeppler@peppler.org
http://www.mbay.net/~mpeppler - mpeppler@mbay.net
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|