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-09 16:37:27
Message-ID: Pine.LNX.4.21.0304091731450.19529-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Tue, 8 Apr 2003, Stu Krone wrote:

>
> I'm trying to execute a postgresql function from perl. The function
> inserts data into two different tables. I prefer this a sopposed to
> using two insert statements. Can anyone point me to any information at
> all on how to execute postgresql functions from Perl? The code for
> Oracle doesn't work. Any help would be appreciated.
>
> Stu Krone
>

Just submit the SQL for it in the normal manner you use in perl:

SELECT domyfunc();

Having been shown some code that runs Oracle procedures recently I think it'll
be particularly easy to make a set of functions you can use in perl that
emulates that particular oddity and generate the SQL. If I didn't know it was
possible to run procedures in Oracle by typing the pl/sql type commands in to
the command line utility I'd have said that's all they were doing since it
seems much more sensible to have an interface on the backend that understands
SQL to do such things rather than SQL and some proprietary language where the
proprietary language is necessary in order to use stored procs.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stu Krone 2003-04-09 16:45:55 Re: How do you execute a postgresql function from perl?
Previous Message Ron Peacetree 2003-04-09 16:35:20 Re: Anyone know why PostgreSQL doesn't support 2 phase