X-Original-To: pgsql-interfaces@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2D1ED475F1B for ; Tue, 29 Apr 2003 10:03:16 -0400 (EDT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 0D393476262 for ; Tue, 29 Apr 2003 10:02:38 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue Apr 29 15:57:17 2003 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id PAA09098; Tue, 29 Apr 2003 15:57:17 +0200 (METDST) From: Christoph Haller Message-Id: <200304291357.PAA02511@rodos> Subject: Re: Read Cursor to C To: gbeletti@yahoo.com.br (=?iso-8859-1?q?Gabriel=20Beletti?=) Date: Tue, 29 Apr 2003 15:57:16 METDST Cc: pgsql-interfaces@postgresql.org In-Reply-To: <20030428180540.84567.qmail@web41402.mail.yahoo.com>; from "=?iso-8859-1?q?Gabriel=20Beletti?=" at Apr 28, 103 8:09 pm X-Mailer: Elm [revision: 212.4] X-Spam-Status: No, hits=-7.8 required=5.0 tests=BAYES_10,INVALID_DATE,IN_REP_TO,NO_DNS_FOR_FROM, QUOTE_TWICE_1 autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/176 X-Sequence-Number: 4115 > > > 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 BINARY CURSOR FOR ") PQexec(.., "FETCH ALL IN ") PQgetvalue(.., .., ..) PQexec(.., "CLOSE ") See the doc on libpq for details. Regards, Christoph