Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4SCR7A91826 for ; Mon, 28 May 2001 08:27:07 -0400 (EDT) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4NERqA94234 for ; Wed, 23 May 2001 10:27:52 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4NEJ6A11806 for pgsql-interfaces@postgresql.org; Wed, 23 May 2001 10:19:06 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.interfaces Subject: ECPG error: break statement not within loop or switch Date: Wed, 23 May 2001 16:19:03 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 45 Message-ID: <3B0BC6D7.E6C65E2A@cybertec.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-interfaces@postgresql.org X-Archive-Number: 200105/112 X-Sequence-Number: 1642 I have written a small application but I can't compile the code because of an error I have never seen before: ecpg retrieve.pgc -o file.c gcc -g -I /usr/include/pgsql -o prog file.c -L /usr/share/pgsql -lecpg -lpq retrieve.pgc: In function `main': retrieve.pgc:57: break statement not within loop or switch make: *** [x] Fehler 1 What does it mean? I have listed the crucial piece of code below: EXEC SQL DECLARE mycursor CURSOR FOR mystatement; EXEC SQL OPEN mycursor; EXEC SQL WHENEVER NOT FOUND DO BREAK; while (1) { EXEC SQL FETCH IN mycursor INTO :id, :name; flag=1; printf("records found: %i, %s\n\n", id, name); } if (flag == 0) { printf("Insert the name of the OS: "); scanf("%256s", inos); EXEC SQL INSERT INTO os (id, name) VALUES (':intext', ':inos'); // THE ERROR OCCURS HERE if (sqlca.sqlcode) { printf("%s\n", sqlca.sqlerrm.sqlerrmc); exit(0); } } EXEC SQL CLOSE mycursor; EXEC SQL DISCONNECT; Can anybody help me? Hans