Hi all,
According to page http://www.gdal.org/ogr/ogr_sql.html , I found that <, >, <=
and >= operators are case sensitive. My code is something like this: and I
couldn't get the required result. Can anyone give me some suggestions?Thanks
for your help!
OGRFeature *pfea = OGRFeature::CreateFeature(poLayerws->GetLayerDefn());
pfea->SetField("codede","CAPITAL");
if (poLayerws->CreateFeature(pfea) != OGRERR_NONE)
{
return false;
}
pfea = OGRFeature::CreateFeature(poLayerws->GetLayerDefn());
pfea->SetField("codede","capital");
if (poLayerws->CreateFeature(pfea) != OGRERR_NONE)
{
return false;
}
string layername = poLayerws->GetName();
string ssf = "SELECT * FROM " + layername + " WHERE codede >= 'capital' AND
codede <= 'capital'" ;
const char *sql = ssf.c_str();
OGRLayer *ret = poDSws->ExecuteSQL(sql,NULL,NULL);
/*value of n is 2*/
int n = ret->GetFeatureCount();
ret->ResetReading();
OGRFeature *pfearet;
/*prints CAPITAL
capital*/
while(pfearet = ret->GetNextFeature())
{
cout<<pfearet->GetFieldAsString("codede")<<endl;
}
poDSws->ReleaseResultSet(ret);
OGRDataSource::DestroyDataSource(poDSws);
OGRCleanupAll();
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev