Re: ProC Mystery

From: Dieter Rohlfing <320003300523_at_t-online.de>
Date: 2000/06/17
Message-ID: <p1pfi8.k71.ln_at_320003300523-0001.dialin.t-online.de>#1/1


On Fri, 16 Jun 2000 15:24:36 GMT, Melissa <mp2114_at_my-deja.com> wrote:

>... and had typed a very simple INSERT instruction. After the
>ProC compiler finished generating the corresponding C file, the CC
>compiler indicated a compile error with the following message:
>Error 1571: Break statement has no enclosing loop or switch.
>
>The odd thing about this problem is that the ProC compiler has placed a
>line of code at the end stating the following:
>if (sqlca.sqlcode == 1403) break;
>
>This line should not even be present in the code. I have looked over
>the code several times and do not see anything wrong with the way the
>INSERT has been coded. To compound the situation further, if the INSERT
>command is commented out of the code, the CC compiler compiles with no
>errors.

[Quoted] There's no mystery at all, ProC compiles correctly according to your *.pc file.

The statement
  if (sqlca.sqlcode == 1403) break;
[Quoted] is generated, because you have a line like   EXEC SQL WHENEVER NOT FOUND DO BREAK;
in your *.pc file.

The WHENEVER line itself does not generate any code, but it controlls the [Quoted] error checking code, that is generated after each DML statement.

For further details have a look in the "Pro*C/C++ Precompiler Programmer's [Quoted] Guide", chapter 11 "Handling Runtime Errors".

Dieter Rohlfing Received on Sat Jun 17 2000 - 00:00:00 CEST

Original text of this message