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: __LINE__ in proc

Re: __LINE__ in proc

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 08 Oct 1998 17:36:45 GMT
Message-ID: <3626f828.11870759@192.86.155.100>


A copy of this was sent to pradeepj_at_delhi.tcs.co.in (if that email address didn't require changing) On Thu, 08 Oct 1998 16:59:17 GMT, you wrote:

>Hi !
> But the line directives included in generated .c file will not help me.
> Actually I am writing some statement like.
>
> printf("Error at line %d in file %s\n", __LINE__ , __FILE__) ;
>
> in my .pc file.
> Now I want the output should gine line position of this
> statement in proc file not the generated 'c' file.
> Same is the case with filename, it should give
> proc file instead of 'c' file.
>
>thanks,
>Pradeep
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
hats EXACTLY what lines=yes will do for you. ProC will stick into the generated .c file the following directives:

    /* EXEC SQL COMMIT WORK RELEASE; */ #line 88 "t.pc"

{

    struct sqlexd sqlstm;

That #line 88 "t.pc" RESETS the __LINE__ macro variable for the C compiler. If you code:

   EXEC SQL COMMIT WORK RELEASE;
   printf( "I'm on line %d\n", __LINE__ );

it will print 88 *not* (as was in my case) line 449 (it was really 449 in the .c file, the #line 88 directive set it BACK to 88)  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
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 Thu Oct 08 1998 - 12:36:45 CDT

Original text of this message

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