[gdal-dev] Retrieving assigned IDENTITY value from MSSQL

Jerry Faust jerryfaust1 at gmail.com
Thu Oct 25 22:32:30 PDT 2018


Thank you for your reply.

Indeed, I had just coded a solution using IDENT_CURRENT.  :-/

However, I have taken your advice and recoded it using the OUTPUT clause,
and it is working well.

Unless I hear otherwise from someone within GDAL that it is not necessary,
I will submit a pull request for consideration.

Again, thank you.
Jerry.

On Thu, Oct 25, 2018 at 4:45 PM Nyall Dawson <nyall.dawson at gmail.com> wrote:

> On Fri, 26 Oct 2018 at 02:30, Jerry Faust <jerryfaust1 at gmail.com> wrote:
> >
> > Hello.
> >
> >
> >
> > I created a few tables in SQL Server by importing Shapefiles using
> ogr2ogr.  I am able to edit the features, but have not been able to add new
> features.
> >
> >
> >
> > After stepping through the code, it appears that after successfully
> inserting the record, the newly assigned FID is not being set into the
> feature - it is still -1 (OGRNullFID).
> >
> >
> >
> > Before I consider making changes, I wonder if I’m just missing
> something.  It would seem that others would have encountered this before.
>
> Coincidentally I fixed a similar issue in QGIS this week -
> https://github.com/qgis/QGIS/commit/972250 . If you go ahead with
> adapting GDAL my advise here would be to use an OUTPUT clause in your
> INSERT instead of using the widespread IDENT_CURRENT approach (for
> some reasons outlined in that commit's message).
>
> Nyall
>


-- 

Jerry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181025/562ab02a/attachment.html>


More information about the gdal-dev mailing list