Problems with Pg::doQuery - Mailing list pgsql-general

From The Web Administrator
Subject Problems with Pg::doQuery
Date
Msg-id 35798C1F.8890054D@wizard.ca
Whole thread Raw
List 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
                      ", \@clients);
# TEST SECTION
for $i (0 .. $#clients) {
   for $j (0 .. $#{$clients[$i]} ) {
      print "$clients[$i][$j]\t";
   }
}
# END TEST SECTION
print @clients;


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Re: [HACKERS] NEW POSTGRESQL LOGOS
Next
From: Oliver Giller
Date:
Subject: Postgresql for Yoga's Data Store