Re: Read Cursor to C

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: gbeletti(at)yahoo(dot)com(dot)br (=?iso-8859-1?q?Gabriel=20Beletti?=)
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Read Cursor to C
Date: 2003-04-29 15:57:16
Message-ID: 200304291357.PAA02511@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

>
>
> Hi, my name is Gabriel and I need to read binary data
> from de DB and write it to a file in C. How do I use
> this cursor? Howm do I read the data from the cursor
> after the query is done and write it to C?
>
Use the libpq interface:

PQexec(.., "DECLARE <cursorname> BINARY CURSOR FOR <query>")

PQexec(.., "FETCH ALL IN <cursorname>")

PQgetvalue(.., .., ..)

PQexec(.., "CLOSE <cursorname>")

See the doc on libpq for details.
Regards, Christoph

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Haron, Charles 2003-04-29 17:12:49 User-defined functions with Kylix/Delphi
Previous Message Garfield Palmer 2003-04-29 00:18:18 libpq msvc crashing