Can not get large cursor for PGLIB ???

Поиск
Список
Период
Сортировка
От TONY J.Y.
Тема Can not get large cursor for PGLIB ???
Дата
Msg-id 006901c17ddf$03318300$7a01a8c0@Aqua.MRF
обсуждение исходный текст
Ответ на Re: Cant load pgtclsh library into application  (Jan Wieck <janwieck@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: dsmclennan@spipowernet.com.au
Дата:
Сообщение: C interface libpq.so.2 problem
Следующее
От: "dfg"
Дата:
Сообщение: how can I use C++ interface in postgresql?