Re: from pgsql_perl5 to DBD-Pg
- From: "Bob" <catdogbeloved@xxxxxxxxx>
- Date: 27 Feb 2007 04:12:25 -0800
.... The previous post formatted like hell. Let see if this does it...
# How to port code from Pg.pm [1] to DBD::Pg.pm [2].
#
# Tested and working thus far:
#
# [1]: $dbh = Pg::connectdb("dbname=$dbname");
# [2]: $dbh = DBI->connect("DBI:Pg:dbname=$dbname", "", "",
{AutoCommit => 1});
#
# [1]: $dbh->exec("<SQL STATEMENT>");
# [2]: $dbh->do("<SQL STATEMENT>"); # non select
# [2]: $sth = $dbg->prepare("<SQL STATEMENT>"); $sth->execute; #
select
#
# [1]: $dbh->status == 0
# [2]: (not defined $dbh->errstr)
#
# Returns the number of records in the query result:
# [1]: $sth->ntuples
# [2]: $sth->rows
#
# Returns the number of fields in the query result:
# [1]: $sth->nfields
# [2]: $sth->{NUM_OF_FIELDS}
#
# Returns the field name associated with the given field number:
# [1] $sth->fname($i)
# [2]: $sth->{NAME}->[$i]
#
# Pending solution thus far:
#
# Prints out all the records in an intelligent manner:
# [1]: $sth->print($fout, $header, $align, $standard, $html3,
$expanded, $pager, $fieldSep, $tableOpt, $caption)
# [2]: N.A.
Bob
.
- References:
- from pgsql_perl5 to DBD-Pg
- From: Bob
- from pgsql_perl5 to DBD-Pg
- Prev by Date: Re: from pgsql_perl5 to DBD-Pg
- Next by Date: esoftmatic.com site is not up. I need oracle DBD and DBI for windows
- Previous by thread: Re: from pgsql_perl5 to DBD-Pg
- Next by thread: Re: from pgsql_perl5 to DBD-Pg
- Index(es):
Relevant Pages
|
|