Re: How do you execute a postgresql function from perl? - Mailing list pgsql-hackers

From Nigel J. Andrews
Subject Re: How do you execute a postgresql function from perl?
Date
Msg-id Pine.LNX.4.21.0304091731450.19529-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to How do you execute a postgresql function from perl?  (Stu Krone <skrone@blueonyxgroup.com>)
Responses Re: How do you execute a postgresql function from perl?
List 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



pgsql-hackers by date:

Previous
From: "Ron Peacetree"
Date:
Subject: Re: No merge sort?
Next
From: Tom Lane
Date:
Subject: Re: Anyone working on better transaction locking?