Received: from ns3.khmere.com (209-249-64-251.snj0.flashcom.net [209.249.64.251]) by hub.org (8.9.3/8.9.3) with ESMTP id BAA29848 for ; Fri, 4 Jun 1999 01:13:23 -0400 (EDT) (envelope-from nathan@khmere.com) From: nathan@khmere.com Received: from khmere.com (IDENT:nathan@ns4.khmere.com [209.249.64.250]) by ns3.khmere.com (8.9.2/8.8.7) with ESMTP id VAA83450 for ; Fri, 4 Jun 1999 21:51:24 GMT Sender: nathan@ns3.khmere.com Message-ID: <37576163.587DC267@khmere.com> Date: Thu, 03 Jun 1999 22:17:23 -0700 X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.5-15smp i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Embedded SQL in 'C' Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Does anyone know how to open a cursor for 'C" ..? I have checked the previous postings but cannot locate the proper syntax here is a snipit : void ShowTable_type(){ EXEC SQL BEGIN DECLARE SECTION; char *Atid; // variables to retrieve the table info char *Adesc; EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT 'nathan'; EXEC SQL DECLARE lets_get_tid CURSOR FOR SELECT type.tid; printf("Choose the TID to delete\n\n \n"); do{ EXEC SQL OPEN lets_get_tid; EXEC SQL FETCH lets_get_tid INTO //line 255 :Atid; printf("%s",Atid); }while(SQLCODE != SQLEND); EXEC SQL CLOSE lets_get_tid; } What am I doing wrong ..? here what happens when I rund ecpg : ecpg 4sql.c -o 4comp.c 4sql.c:124: parse error make: *** [sql] Error 255 Please if anyone has any ideas please let me know. Thank you Nathan