pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: nathan@khmere.com
To: pgsql-sql@postgresql.org
Subject: Embedded SQL in 'C'
Date: Thu, 03 Jun 1999 22:17:23 -0700
Message-ID: <37576163.587DC267@khmere.com> (raw)

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<TID> \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




Message-ID: <37576163.587DC267@khmere.com>
Permalink:  ../37576163.587DC267@khmere.com/
Also on:    postgresql.org/message-id/37576163.587DC267@khmere.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: nathan@khmere.com
  Subject: Re: Embedded SQL in 'C'
  In-Reply-To: <37576163.587DC267@khmere.com>
  References: <37576163.587DC267@khmere.com>

* 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