Problems with Pg::doQuery

From: The Web Administrator <wwwadmin(at)wizard(dot)ca>
To: marin(at)cybernet(dot)bg, PostGres General Questions <pgsql-general(at)postgresql(dot)org>
Subject: Problems with Pg::doQuery
Date: 1998-06-06 18:36:15
Message-ID: 35798C1F.8890054D@wizard.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Well, I have been using $result->getvalue up to now, and individually
accessing records in my databases, but I thought I would try the 'easy'
way now. So much for that idea...
I took this example script, (taken from the 'perldoc pg') and ran it,
but get no results no matter what. (It actually comes from a much
bigger script of course)
The search returns results when executed directly, but via Pg::doQuery I
seem to never get any results.. is it a flaw in the documented example?
I had thought it might be the use of LIKE vs ~ at first, but after
sorting that all out I realized that it was never returning anything,
unless I have made a stupid syntax error that I am too blind to
see.....(nawww... that never happens...)

----<pasted>------
#!/usr/bin/perl
#
# List By Alphabet
# This script takes a look at all clients in the
# database 'people' and allows it to be updated.
#
###########################################################################

# Variable List
#
use Pg;
$conn=Pg::connectdb("dbname=people");

###########################################################################

Pg::doQuery($conn,"SELECT id,firstname,lastname,company
FROM clients
# WHERE lastname ~ '$sortby'
# OR lastname ~ 'lower($sortby)'
# ORDER BY lastname ASC
", \(at)clients);
# TEST SECTION
for $i (0 .. $#clients) {
for $j (0 .. $#{$clients[$i]} ) {
print "$clients[$i][$j]\t";
}
}
# END TEST SECTION
print @clients;

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Giller 1998-06-06 18:45:29 Postgresql for Yoga's Data Store
Previous Message Bruce Momjian 1998-06-06 15:27:44 Re: [GENERAL] Re: [HACKERS] NEW POSTGRESQL LOGOS