[gdal-dev] querry in updating attribute values using ogrdatasource

SIVA RAMA KRISHNA s.r.kriishna at gmail.com
Thu Aug 14 07:47:38 PDT 2014


Hello,

I am trying to update shape file with attribute values .I am performing
following

functionality.

QFileInfo table1(_mActiveLayer); //_mActive Layer is name of file opened
QString tablename1;
tablename1=table1.baseName();
reader = OGRSFDriverRegistrar::Open(_mActiveLayer.toLatin1().data(), TRUE );
    if(reader==NULL)
    {
        exit(0);
    }


poLayer = reader->GetLayer(0);
querrysatatement="UPDATE " +tablename1+" set  SAL= 500 where EMPCODE = 1"
;//table Name is name of the table releated to _mActiveLayer
QByteArray bnewconn = querrysatatement.toLatin1();
conninfonew = new char[bnewconn.length()+1];
strcpy(conninfonew,querrysatatement.toLatin1().data());
poLayer=reader->ExecuteSQL (conninfonew,NULL,dialect.toLatin1().data());

OutPut
syntax error in sql statement

Environment:

Unbuntu 12.04

Gdal version -- 1.9.2
geos version --  3.3.3

Thanks in advance to all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140814/812be765/attachment.html>


More information about the gdal-dev mailing list