Skip site navigation (1) Skip section navigation (2)

Re: ECPG error: break statement not within loop or switch

From: Christof Petig <christof(at)petig-baender(dot)de>
To: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: ECPG error: break statement not within loop or switch
Date: 2001-07-06 08:07:14
Message-ID: 3B4571B2.8085019B@petig-baender.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hans-Jürgen Schönig wrote:

> I have written a small application but I can't compile the code because
> of an error I have never seen before:

[...]

> retrieve.pgc: In function `main':
> retrieve.pgc:57: break statement not within loop or switch
> make: *** [x] Fehler 1
>
>         EXEC SQL WHENEVER NOT FOUND DO BREAK;

this statement inserts a 'if (sqlca.sqlcode==100) break;' after each SQL
statement following

>                 EXEC SQL INSERT INTO os (id, name) VALUES (':intext',
> ':inos');         // THE ERROR OCCURS HERE

and here it harms (of course)

you should insert
    EXEC SQL WHENEVER NOT FOUND CONTINUE;
after the while loop.

Yours
   Christof





In response to

pgsql-interfaces by date

Next:From: Christof PetigDate: 2001-07-06 08:09:36
Subject: Re: libpq and _pgmodule under WinNT without cygwin
Previous:From: Hiroshi InoueDate: 2001-07-06 00:20:52
Subject: Re: ADO and ODBC: More

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group