Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Pro*C problem please help !!!

Re: Pro*C problem please help !!!

From: <jairamk_at_geocities.com>
Date: 1998/03/03
Message-ID: <6dgmg8$nqp$1@nnrp1.dejanews.com>#1/1

you also have to initialise the flag orastxtf in oraca... this decides when the statemnet is written into the Oracle Communications area... for ex:
oraca.orastxtf=ORASTFANY; // This specifies that any error or warning results

                          //in the statment being written into the oraca
Jairam Kuppuswamy
Software Engineer - Database
Daxxes Information Technology Private Limited. bangalore, India.

In article <34f6818a.6852843_at_192.86.155.100>,   tkyte_at_us.oracle.com wrote:
>
> 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.
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue Mar 03 1998 - 00:00:00 CST

Original text of this message

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