Can not get large cursor for PGLIB ??? - Mailing list pgsql-interfaces

From TONY J.Y.
Subject Can not get large cursor for PGLIB ???
Date
Msg-id 006901c17ddf$03318300$7a01a8c0@Aqua.MRF
Whole thread Raw
In response to Re: Cant load pgtclsh library into application  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-interfaces
Hi all,

I am using the PGLIB C lib to connect to PgSql to finish the query of
the GEOMETRY of a table.

At first, everything was OK. I could insert, update, delete and select of
whatever I wanted while the geometry data was small one.

So I wanted to try a bigger one. I uploaded a ESRI shape file into database
which was in the attachment --- Canada.sql. Then I tried the query.
   res = PQexec(conn, "DECLARE mycursor BINARY CURSOR FOR select gid, name,
asbinary(the_geom) from canada");
   if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)   {       fprintf(stderr, "DECLARE CURSOR command failed\n");
   PQclear(res);       exit_nicely(conn);   }   PQclear(res);
 
   res = PQexec(conn, "FETCH ALL in mycursor");   if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)   {
fprintf(stderr,"FETCH ALL command didn't return tuples
 
properly\n");       PQclear(res);       exit_nicely(conn);   }


Then I got the error when try to "FETCH ALL in mycursor".

Could you help me to figure out the problem? Thanks. I have attached
the files needed for you.


Best regards,
Tony

---
Tony Jiang, MSc
Research & Development Programmer/Analyst
MRF Geosystems Corp (www.mrf.com)
Suite 700, 665 8th Street SW,
Calgary, AB T2P 3K7
(403) 216-5515 ext:226



pgsql-interfaces by date:

Previous
From: dsmclennan@spipowernet.com.au
Date:
Subject: C interface libpq.so.2 problem
Next
From: "dfg"
Date:
Subject: how can I use C++ interface in postgresql?