Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Execute immediate

Re: Execute immediate

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 6 Feb 2003 15:14:02 -0000
Message-ID: <3e427bbb$0$245$ed9e5944@reading.news.pipex.net>


"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 UK
Received on Thu Feb 06 2003 - 09:14:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US