Re: [PATCHES] prepareable statements

From: Marc Lavergne <mlavergne-pub(at)richlava(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] prepareable statements
Date: 2002-07-24 06:05:57
Message-ID: 3D3E43C5.3020609@richlava.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

To expand on the Oracle implementation, the EXECUTE command in SQL*Plus
results in an anonymous pl/sql block (as opposed to a named procedure).
being sent over the wire such as the following:

begin
my_procedure();
end;

As mentioned in the previous post, the EXECUTE command is only a
SQL*Plus keyword (well, Server Manager too but that was killed in 9i).

Mike Mascari wrote:
> Rod Taylor wrote:
>
>>On Tue, 2002-07-23 at 11:34, Tom Lane wrote:
>>
>>>nconway(at)klamath(dot)dyndns(dot)org (Neil Conway) writes:
>>>
>>>>Regarding the syntax for EXECUTE, it occurs to me that it could be made
>>>>to be more similar to the PREPARE syntax -- i.e.
>>>
>>>>PREPARE foo(text, int) AS ...;
>>>
>>>>EXECUTE foo('a', 1);
>>>
>>>>(rather than EXECUTE USING -- the effect being that prepared statements
>>>>now look more like function calls on a syntactical level, which I think
>>>>is okay.)
>>>
>>>Hmm, maybe *too* much like a function call. Is there any risk of a
>>>conflict with syntax that we might want to use to invoke stored
>>>procedures? If not, this is fine with me.
>>
>>Stored procedures would use PERFORM would they not?
>>
>>I like the function syntax. It looks and acts like a temporary 'sql'
>>function.
>
>
> FWIW, Oracle uses EXECUTE to execute stored procedures. It is not apart
> of the SQL language, but a SQL*Plus command:
>
> EXECUTE my_procedure();
>
> The Oracle call interface defines a function to call stored procedures:
>
> OCIStmtExecute();
>
> Likewise, the privilege necessary to execute a stored procedure is
> 'EXECUTE' as in:
>
> GRANT EXECUTE ON my_procedure TO mascarm;
>
> Again, FWIW.
>
> Mike Mascari
> mascarm(at)mascari(dot)com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Lavergne 2002-07-24 06:22:39 CREATE SYNONYM suggestions
Previous Message Marc Lavergne 2002-07-24 05:00:38 Re: C vs. C++ contributions

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-07-24 16:51:10 Proposal: anonymous composite types for Table Functions (aka SRFs)
Previous Message Neil Conway 2002-07-24 03:23:11 inet support for contrib/array