[gdal-dev] Questions about SQL cursors in GDAL driver
Tamas Szekeres
szekerest at gmail.com
Fri Jul 10 17:25:44 EDT 2009
Jorge,
I'm a bit hesitant to think using a server cursor would be the best approach
here. Could you explain why is this needed?
I my understanding each IReadBlock would trigger a normal "SELECT" without
the cursor, this will give you all the data at once, just like FETCH ALL.
This select would in fact be a spatial select according to the extent of the
block required by the client.
Best regards,
Tamas
2009/7/10 Jorge Arévalo <jorge.arevalo at gmail.com>
> Hello,
>
> Context: GDAL WKTRaster Driver. When creating Dataset, I declare a
> cursor to read all the rows (tiles) of a table with a raster column
> (DECLARE cursor CURSOR FOR SELECT * FROM TABLE). The RasterBand should
> read one of the rows' band
>
> Question 1: The cursor is created during the Dataset creation, and
> stored in it. Should I start a transaction before? If yes, when should
> I close the cursor and end the transaction? When calling to Dataset's
> destructor?
> Question 2: What approach is better?
> a) The Dataset fetchs all the rows (tiles) of the table just
> after declaring the cursor, and the RasterBand moves over the
> resultset using PQgetvalue and read one band of the read raster
> b) The Dataset declare the cursor and the RasterBand fetchs the
> row that needs to read one of its bands
>
> Thanks in advance.
>
> Best regards
> Jorge
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090710/801666b5/attachment-0001.html
More information about the gdal-dev
mailing list