<div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br><br></div>I am trying to update shape file with attribute values .I am performing following <br><br>functionality.<br><br>QFileInfo table1(_mActiveLayer); //_mActive Layer is name of file opened<br>
QString tablename1;<br>tablename1=table1.baseName();<br>reader = OGRSFDriverRegistrar::Open(_mActiveLayer.toLatin1().data(), TRUE );<br> if(reader==NULL)<br> {<br> exit(0);<br> }<br><br><br>poLayer = reader->GetLayer(0);<br>
querrysatatement="UPDATE " +tablename1+" set SAL= 500 where EMPCODE = 1" ;//table Name is name of the table releated to _mActiveLayer<br>QByteArray bnewconn = querrysatatement.toLatin1();<br>conninfonew = new char[bnewconn.length()+1];<br>
strcpy(conninfonew,querrysatatement.toLatin1().data());<br>poLayer=reader->ExecuteSQL (conninfonew,NULL,dialect.toLatin1().data());<br><br></div>OutPut<br></div>syntax error in sql statement<br><br></div>Environment:<br>
<br></div>Unbuntu 12.04 <br><br></div>Gdal version -- 1.9.2<br></div>geos version -- 3.3.3<br><br></div>Thanks in advance to all<br><br> <br></div>