Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamically calling stored procedures from C
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
--Received on Fri May 09 1997 - 00:00:00 CDT
------------------------------------------------------------------------
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
------------------------------------------------------------------------