From: Christof Petig <christof@petig-baender.de>
To: Hans-Jürgen Schönig <hs@cybertec.at>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ECPG error: break statement not within loop or switch
Date: Fri, 06 Jul 2001 10:07:14 +0200
Message-ID: <3B4571B2.8085019B@petig-baender.de> (raw)
References: <3B0BC6D7.E6C65E2A@cybertec.at>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: christof@petig-baender.de, hs@cybertec.at
Subject: Re: ECPG error: break statement not within loop or switch
In-Reply-To: <3B4571B2.8085019B@petig-baender.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox