[mapguide-users] How to select expression with the FDO provider
forSDF
Greg Boone
greg.boone at autodesk.com
Tue Feb 6 10:08:46 EST 2007
I believe you need to use the FDO SelectAggregates command as generally
outlined below....
FdoPtr<FdoIDataReader> myDataReader;
FdoPtr<FdoISelectAggregates> selCmdAggreg;
selCmdAggreg = (FdoISelectAggregates*)mConnection->CreateCommand(
FdoCommandType_SelectAggregates );
selCmdAggreg->SetFeatureClassName(L"ClassA");
FdoPtr<FdoComputedIdentifier> cmpId =
(FdoComputedIdentifier*)FdoExpression::Parse(L"(PropertyA*PropertyB) AS
FunctionA");
FdoPtr<FdoIdentifierCollection> idCol =
selCmdAggreg->GetPropertyNames();
idCol->Add( cmpId );
myDataReader = selCmdAggreg->Execute();
while ( myDataReader->ReadNext() )
{
printf("(PropertyA*PropertyB) = %ls\n",
myDataReader->GetString(L"FunctionA") );
}
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Bruno Scott
Sent: Tuesday, February 06, 2007 5:50 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] How to select expression with the FDO provider
forSDF
I'm trying to select expression using the FDO provider for SDF but it
always
return me errors
This is my sample code
FdoPtr<FdoISelect> sampleSelect;
FdoPtr<FdoIFeatureReader> sampleFeatureReader;
FdoPtr<FdoIdentifier> queryPropertyName;
sampleSelect = (FdoISelect
*)m_connection->CreateCommand(FdoCommandType_Select);
sampleSelect->SetFeatureClassName("Parcels");
FdoPtr<FdoIdentifierCollection> propertyCollection =
sampleSelect->GetPropertyNames();
queryPropertyName = FdoIdentifier::Create("AREA * LAND_VALUE");
propertyCollection->Add(queryPropertyName);
sampleFeatureReader = sampleSelect->Execute();
What am i doing wrong?
Thanks
Bruno Scott
--
View this message in context:
http://www.nabble.com/How-to-select-expression-with-the-FDO-provider-for
-SDF-tf3179976s16610.html#a8823998
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070206/82202316/attachment-0001.html
More information about the mapguide-users
mailing list