[mapguide-users] ExecuteSqlQuery Not Working

flakesns flakesns at gmail.com
Sun Mar 15 22:53:06 EDT 2009



I use MgFeatureQueryOptions  now. The question how to select distinct the
property value from the dbf file?

$queryOptions = new MgFeatureQueryOptions();
    
    $queryOptions->AddFeatureProperty("CATEGORY");
    //$queryOptions->SetFilter($sql); // HOW TO SELECT DISTINCT/UNIQUE
VALUE????????

    $featureReader = $featureService->SelectFeatures($layerFeatureResource,
$featClassName, $queryOptions);
    
    while ($featureReader->ReadNext())
    {
       echo '<br>'.$category = $featureReader->GetString('CATEGORY');
    }




Jackie Ng wrote:
> 
> The SHP provider does not support SQL commands. 
> 
> You have to use MgFeatureQueryOptions to do your queries.
> 
> - Jackie
> 
> 
> flakesns wrote:
>> 
>> I got problem here.
>> 
>> here is my code (php):
>> 
>> $layerFeatureResource = new MgResourceIdentifier($layerFeatureId);
>> 
>> $sql = "select road_name from roadTable where featId = 2";
>> $sqlDataReader = $featureService->ExecuteSqlQuery($layerFeatureResource,
>> $sql);
>> 
>> It's return me : 
>> 
>> "The requested operation is invalid.
>> 
>> The requested operation is invalid. Exception occurred in method
>> MgServerSqlCommand."
>> 
>> I use connection to shp folder and data store in dbf file.
>> 
>> Whats the problem exactly?
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/ExecuteSqlQuery-Not-Working-tp2472312p2483908.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list