Your code is way wrong:
exec sql begin declare section;
OCIExtProcContext *epctx;exec sql end declare section;
void extp1(
epctx)
{
char name[15];
exec sql register connect USING :epctx;
EXEC SQL WHENEVER SQLERROR goto err;
EXEC SQL SELECT ename INTO :name FROM emp WHERE empno = 9999;
return;
err:
SQLExtProcError(SQL_SINGLE_RCTX,sqlca.sqlerrm.sqlerrmc,sqlca.sqlerrm.sqlerrml);
return;
}
You have TWO variables epctx. One is global (a big no-no in an extproc btw -- do NOT use globals), the other is local (and untyped).
In the procedure extp1 the ariable epctx is a parameter passed to it with a default type - a type that is explicitly not "OCIExtProcContext *" (its an int or a char or something, I forget what the default type in C is -- mostly because I would never rely on it).
Code:
void extp1(
OCIExtProcContext * epctx)
{
char name[15];
exec sql register connect USING :epctx;
EXEC SQL WHENEVER SQLERROR goto err;
EXEC SQL SELECT ename INTO :name FROM emp WHERE empno = 9999;
return;
as I did and lose that global variable that is out of scope in that function anyway.
You can ask questions of me from the homepage on </code>
http://asktom.oracle.com/ <code>but as there is only one of me and many people out there -- I am frequently in the mode of "not accepting questions, try later".