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

Home -> Community -> Usenet -> c.d.o.misc -> Re: calling stored procedures using dynamic sql

Re: calling stored procedures using dynamic sql

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1997/01/15
Message-ID: <5biijl$1t2@newton.pacific.net.sg>#1/1

akdh_at_ihug.co.nz (Andrew Holman) wrote:
>I want to call a stored procedure using proC and dynamic SQL. But I get
>the error "ORA-00900: invalid SQL statement" returned. Does anyone know if
>this is possible or do I have to use embedded SQL.
>
>I have tried calling a stored procedure which takes no parameters using
>method 1 i.e
>
>strcpy (sqlcommand, "calldemo.test_proc");
>EXEC SQL EXECUTE IMMEDIATE :sqlcommand;
>
>Also method 2 has been tried.
>
>Thanks
>Andrew Holman
>

Hi there,

You need to execute the stored procedure in a PL/SQL block.I am not sure whether IMMEDIATE command executes the stored procedure. The syntax goes like this

EXEC SQL
    YOUR PL/SQL block    

END-EXEC Regards

N.Prabhakar Received on Wed Jan 15 1997 - 00:00:00 CST

Original text of this message

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