Re: How do you execute a postgresql function from perl?

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Stu Krone <skrone(at)blueonyxgroup(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How do you execute a postgresql function from perl?
Date: 2003-04-11 22:04:46
Message-ID: Pine.LNX.4.21.0304112259460.31910-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I meant to give a perl example.

Using DBI:

$sth = $dbh->prepare('select myfunc2(?)');
$rv = $sth->execute($myvar);
print "Number rows = ", $sth->rows, "\n";
while ($data = $sth->fetchrow_array) {
print "Data: ", $data[0], "\n";
}
$sth->finish;

I can't remember the Pg.pm syntax, I only see that in support mode at the
moment so don't really pay much attention to it.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stu Krone 2003-04-11 22:12:25 Re: How do you execute a postgresql function from perl?
Previous Message Bob Kline 2003-04-11 21:45:19 Re: Upgrade to RedHat 9.0 broke PostgreSQL