Re: Pro*C problem please help !!!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1998/02/25
Message-ID: <34f6818a.6852843_at_192.86.155.100>#1/1


A copy of this was sent to rchak_at_netcom.com (Ranga Chakravarthi) (if that email address didn't require changing) On Wed, 25 Feb 1998 19:12:37 GMT, you wrote:

Sounds like you missed the:

/* The ORACA=YES option must be specified to enable use of
 * the ORACA.
 */

EXEC ORACLE OPTION (ORACA=YES); portion of sample8..... there is a command line option:

oraca no control the use of the ORACA

that you could use as well (although putting it right into the file is probably best)

>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.
>
>- ranga
>
>===========================================================================
>I am having trouble getting the oracle statement, filename and line number
>of the SQL statement from the oraca structure.
>
>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,
>
>- ranga
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Feb 25 1998 - 00:00:00 CET

Original text of this message