RE: (Fwd) DBI's method for reading [row x,field y]
- From: catdogbeloved@xxxxxxxxx (Bob Hunter)
- Date: Tue, 27 Feb 2007 14:07:06 -0800 (PST)
The same example, using Pg...
# use Pg;
# my $dbh = Pg::connectdb("dbname=<dbname>");
# my $sth = $dbh->exec("<SQL STATEMENT>");
# for (my $i = 0; $i < $sth->ntuples; $i++) {
# for (my $j = 0; $j < $sth->nfields; $j++) {
# print "Value at ($i,$j):
$sth->getvalue($i,$j)\n";
# }}
It is more concise, and more intuitive.
It is a pity that DBI is so cumbersome.
Yes, DBI is faster and independent from specific
databases, but Pg is far more elegant. Too bad one
cannot have both worlds.
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
.
- Follow-Ups:
- RE: (Fwd) DBI's method for reading [row x,field y]
- From: Philip Garrett
- RE: (Fwd) DBI's method for reading [row x,field y]
- References:
- RE: (Fwd) DBI's method for reading [row x,field y]
- From: Philip Garrett
- RE: (Fwd) DBI's method for reading [row x,field y]
- Prev by Date: RE: (Fwd) DBI's method for reading [row x,field y]
- Next by Date: Re: (Fwd) DBI's method for reading [row x,field y]
- Previous by thread: RE: (Fwd) DBI's method for reading [row x,field y]
- Next by thread: RE: (Fwd) DBI's method for reading [row x,field y]
- Index(es):