[gdal-dev] Questions about SQL cursors in GDAL driver
szekerest at gmail.com
Fri Jul 10 17:25:44 EDT 2009
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.
2009/7/10 Jorge Arévalo <jorge.arevalo at gmail.com>
> 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
> 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
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev