Re: After precompilation in PRO*C and other errors
Date: Sat, 22 May 1999 04:26:20 GMT
Message-ID: <Mlq13.1510$M12.1921_at_news.rdc1.bc.wave.home.com>
In article <oX703.129$b61.710_at_afrodite.telenet-ops.be>, "Copy Man" 
<copyman_at_dma.be> wrote:
>Hi,
>
>I have a bit of a problem, I have an assignment for school to write a PRO*C
> application on a VMS system.
>
>The problem is that if I precompile my code, it puts if ( sqlca.sqlcode == 1403
> ) break; pieces of code in some places
>where the compiler complains they shouldn't be there.
>
>The error I recieve is that I am putting in a break command without being in a
> loop, how can I solve this.
>
>I also recieve an error on line 1992 of my .c source, not the .pc source. And
> if I remove some lines of my code the
>error is still on line 1992. This error is 'internal compiler error'. Others
> have also programs but they seem to work,
>so I think it is my fault.
>
>Is there anyone willing to look into this problem, either by looking at my
> code(not that big, just about 30k) or telling
>me what the heck is wrong???
>
>Thanks,
>
>Dominick
>
>
Yo Dominick
I think you have a statement like
EXEC SQL WHENEVER NOTFOUND break;
somewhere in your .pc source. This compiler directive, tells Proc to insert the statement you are having problems with directly after calls to Oracle. There are many different ways of skinning this particular cat, but one way is to code the following two statements at the top of your .pc but below the include for sqlca.h.
        EXEC SQL WHENEVER NOTFOUND continue;
        EXEC SQL WHENEVER SQLERROR continue;
This prevents the precompiler from inserting those nasty statements in your code and you are free to put them in yourself something like...
#define SQL_OK               0L
#define SQL_NOTFOUND 1403L
#define any others here...like DUP_VAL_ON_INDEX 
..
        EXEC SQL etc etc
        
        if (sqlca.sqlcode == SQL_NOTFOUND)
                do something...
        if (sqlca.sqlcode != SQL_OK)
                die("Oracle raised an Exception");
..
TheWils.
thewils_at_hotmail.com
Received on Sat May 22 1999 - 06:26:20 CEST
