Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Pro*C problem please help !!!
Hi Pro*C/Unix gurus,
I posted this couple of weeks back and am posting it again. If anyone can let me know what is wrong, I would greatly appreciate.
This is the piece of code I use in my Pro*C program :
#include <oraca.h>
..
main() {
oraca.orastxtf = ORASTFANY;
EXEC SQL WHENEVER SQLERROR DO sql_error("Select error");
.. select statement goes here ..
.
}
void sql_error(char *msg) {
printf("\n%s", msg);
sqlca.sqlerrm.sqlerrmc[sqlca.sqlerrm.sqlerrml] = '\0'; oraca.orastxt.orastxtc[oraca.orastxt.orastxtl] = '\0'; oraca.orasfnm.orasfnmc[oraca.orasfnm.orasfnml] = '\0'; printf("\n%s\n", sqlca.sqlerrm.sqlerrmc);printf("in \"%s...\"\n", oraca.orastxt.orastxtc); printf("on line %d of %s.\n\n", oraca.oraslnr,
oraca.orasfnm.orasfnmc);
EXEC SQL WHENEVER SQLERROR CONTINUE;
EXEC SQL ROLLBACK RELEASE;
exit(1);
}
When I compile and run the program this is what I get :
Select error.
ORA-01722: invalid number
in "..."
on line 0 of .
Why am I not getting the orastxtc and orafnmc strings in the output? BTW, the sql_error() function is a cut&paste from proc/demo/sample8.pc I have tried ORASTFERR for oraca.orastxtf. No use!! Could anybody please help me understand what is going on here? Is there any special flags that need to be passed to the precompiler?
TIA,
-- -------------------------------------------------------------------------- Work fascinates me ... I can sit and look at it for hours -------------------------------------------------------------------------- Ranga Chakravarthi Ph : (504) 295 1189 (H) 11555 Southfork Ave #2092 e-mail : rchak_at_netcom.com Baton Rouge LA - 70816 --------------------------------------------------------------------------Received on Wed Feb 25 1998 - 00:00:00 CST