[gdal-dev] OGR: Get FID of last set feat in PG
Tom van der Putte
tom at vdputte.nl
Wed Sep 8 11:36:30 EDT 2010
In reply to my own question, I've created something that works:
Layer tempLayer = ds2.ExecuteSQL("SELECT
currval(pg_get_serial_sequence('wells', 'well_id')) as seqval;", null,
null);
Feature seqFeat = tempLayer.GetNextFeature(); //always only 1 row in
the resultset, so no *while*
tempFID = seqFeat.GetFieldAsInteger("seqval");
ds2.ReleaseResultSet(tempLayer);
Is it necessary to call ReleaseResultSet after every ExecuteSQL? Or
only after the last one?
Cheers,
Tom
On Wed 08/09/10 16:03 , Tom van der Putte tom at vdputte.nl sent:
Hi All,
I'm adding several new features to a PostGIS table using OGR (in
C#). After each CreateFeature I'd like to somehow get the FID of the
created feature. Is there any possible way to do this? If not elegant,
any hack is also welcome :D
Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100908/67b8fcbb/attachment.html
More information about the gdal-dev
mailing list