Deleting Values

FDO API

 
Deleting Values
 
 
 

In addition to inserting (see Inserting Values) and updating (see Updating Values) values, you can delete the values. The deletion operation involves identifying a feature class (“table”) whose feature class objects (“rows”) are to be deleted.

First, create an FdoIDelete command object and use the command object’s SetFeatureClassName() method to identify the feature class. Then, create a filter to identity the feature class objects that you want to delete, and use the command object’s SetFilter() method to attach the filter to it. You can use the same filter that was specified in the preceding section, Updating Values. Finally, execute the command.

Example: Deleting Property Values

FdoPtr<FdoIDelete> sampleDelete;
sampleDelete =
    (FdoIDelete *)connection->CreateCommand(FdoCommandType_Delete);
FdoInt32 numDeleted = 0;
sampleDelete-> 
SetFeatureClassName(L"SampleFeatureSchema:SampleFeatureClass");
sampleDelete->SetFilter(L"( SampleIdentityDataProperty = 101 )");
numDeleted = sampleDelete->Execute();