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

From: Stu Krone <skrone(at)blueonyxgroup(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How do you execute a postgresql function from perl?
Date: 2003-04-09 16:45:55
Message-ID: 3E944E43.50801@blueonyxgroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Yeah, I tried that. I even used the same syntax that works for Oracle.
The interface said it couldn't handle BEGIN and END in the sql call. I
still can't find any syntax that actually executes the function. It's
actually pretty surprising to me since executing a stored proc is pretty
basic stuff.
Thanks for the help anyway!

Stu

Nigel J. Andrews wrote:
> 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.
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-04-09 16:48:04 Re: Anyone working on better transaction locking?
Previous Message Nigel J. Andrews 2003-04-09 16:37:27 Re: How do you execute a postgresql function from perl?