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 -> Dynamically calling stored procedures from C

Dynamically calling stored procedures from C

From: Brian Rasmusson <br_at_belle.dk>
Date: 1997/05/09
Message-ID: <337325AF.46A1@belle.dk>#1/1

Hi,

I'm trying to dynamically call a stored procedure. I do not want to hardcode procedure names, but have them passed as parameter to a C function instead. I have tried the following code as a test:

EXEC SQL BEGIN DECLARE SECTION;
    varchar mystmt[2001];
EXEC SQL END DECLARE SECTION;     mystmt.len = sprintf((char *)mystmt.arr,

                "EXECUTE testpack.UnblockUser('1','comment')");
 

EXEC SQL PREPARE stprc FROM :mystmt;
OraclePrintError(__FILE__,__LINE__);  

EXEC SQL EXECUTE stprc;
OraclePrintError(__FILE__,__LINE__);  

It results in an ORA-900 error, or ORA-1003 if I try without the EXECUTE command. Have you got a solution on how to handle this?

Regards,
Brian

-- 

------------------------------------------------------------------------
Brian Rasmusson, Software engineer & analyst e-mail: brianr_at_belle.dk Belle Systems A/S web : www.belle.dk Network, Internet and communication specialists phone : +45 59442500
------------------------------------------------------------------------
Received on Fri May 09 1997 - 00:00:00 CDT

Original text of this message

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