From: Christoph Haller <ch@rodos.fzk.de>
To: gbeletti@yahoo.com.br
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Read Cursor to C
Date: Tue, 29 Apr 2003 15:57:16 METDST
Message-ID: <200304291357.PAA02511@rodos> (raw)
In-Reply-To: <20030428180540.84567.qmail@web41402.mail.yahoo.com>
>
>
> 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
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: ch@rodos.fzk.de, gbeletti@yahoo.com.br
Subject: Re: Read Cursor to C
In-Reply-To: <200304291357.PAA02511@rodos>
* 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