[postgis] Why is there the limitation of PGLIB to get the cursor?

TONY J.Y. tjiang at mrf.com
Wed Dec 5 12:27:17 PST 2001


Hi,

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

At first, everything is OK. I can insert, update, delete and select of
whatever I want. But the geometry data is very small one.

So I wanted to try a bigger one. I uploaded a ESRI shape file into database
which in the attachment --- Canada.sql. Then I try 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




------------------------ Yahoo! Groups Sponsor ---------------------~-->
See What You've Been Missing!
Amazing Wireless Video Camera.
Click here
http://us.click.yahoo.com/75YKVC/7.PDAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: canada.sql
Type: application/octet-stream
Size: 627961 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20011205/a605ce7f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: application/octet-stream
Size: 4644 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20011205/a605ce7f/attachment-0001.obj>


More information about the postgis-users mailing list