Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Execute immediate
"Adrien" <Adrien_at_nospam.com> wrote in message
news:200326-12118-911965_at_foorum.com...
>
> Hello,
>
> If I execute a stored function in SQLPlus :
>
> variable a number;
> BEGIN
> :a := MyFunction ( NULL );
> END;
> /
>
> It works.
>
> But the same statement in an 'EXECUTE IMMEDIATE' statement in PL/SQL :
>
> EXECUTE IMMEDIATE 'variable a number; BEGIN :a := AlimGCE_CONT ( NULL );
> END;';
>
> doesn't work =>
> ORA-00900: invalid SQL statement
>
Yes. execute immediate is a way of dynamically executing SQL not PL/SQL just use the PLSQL in the normal way.
-- Niall Litchfield Oracle DBA Audit Commission UKReceived on Thu Feb 06 2003 - 09:14:02 CST