Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Conditional Procedure Creation
Yeah,
you'll need to use dbms_sql (7.3 and 8.0) or execute immediate for this, as
pl/sql doesn't support DDL directly.
Regards,
Sybrand Bakker, Oracle DBA
"Vaughan Jackson" <vaughan_jackson_at_my-deja.com> wrote in message
news:8qgnrq$365$1_at_nnrp1.deja.com...
> Hi,
>
> I would like to be able to create a stored procedure, in one of two
> different ways, according to certain database settings, something like
> this
>
> if <database supports feature>
> then
> create procedure my_procedure() as
> begin
> <implementation using feature>
> end my_procedure;
> else
> create procedure my_procedure() as
> begin
> <implementation not using feature>
> end my_procedure;
> end if;
>
> However, whenever I try this in sqlplus, I get syntax error
> messages telling me that "create" was not expected after the
> "then". I cannot use #ifdefs, because the condition concerned is one
> to be found in the DB itself.
>
> Thanks,
>
> Vaughan Jackson.
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Sep 23 2000 - 05:53:40 CDT