[fdo-users] How to remove a property definition from a feature class

Ray ray.wu at efacec.com
Tue Jul 17 12:17:47 PDT 2012


I created a feature class using FDO in Oracle. It is like a table in Oracle.
Now I want to drop a column from the table. How can I do it using FDO?

Here is the code snippet I used to remove the column, but it doesn't work.

''' Describe schema
oCommand =
FDOConnection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_DescribeSchema)
oDescribeSchema = CType(oCommand, OSGeo.FDO.Commands.Schema.IDescribeSchema)
 oFeatureSchemaCollection = oDescribeSchema.Execute()


''Get the feature schema and feature class
       For i = 0 To oFeatureSchemaCollection.Count() - 1

                oFeatureSchema = oFeatureSchemaCollection.Item(i)
                oSchemaClassCollection = oFeatureSchema.Classes()

                Dim oClasses As OSGeo.FDO.Schema.ClassCollection =
oFeatureSchema.Classes()
                 ......
                 oFeatureClass = oSchemaClassCollection.Item(j)


''Remove property definiction from the feature class
   oPropertyDefinitionCollection = oFeatureClass.Properties()

                For Each oPropertyDefinition In
oPropertyDefinitionCollection
            If oPropertyDefinition.Name.ToUpper = sPropertyName.ToUpper Then
                oPropertyDefinitionCollection.Remove(oPropertyDefinition)
................

                  
 ''Save the schema
        Dim oCommand As OSGeo.FDO.Commands.ICommand
        Dim oApplySchemaCmd As OSGeo.FDO.Commands.Schema.IApplySchema
        oCommand = oFDOConnection.CreateCommand
(OSGeo.FDO.Commands.CommandType.CommandType_ApplySchema)
        oApplySchemaCmd = CType(oCommand,
OSGeo.FDO.Commands.Schema.IApplySchema)
        oApplySchemaCmd.FeatureSchema = oFeatureSchema
        oApplySchemaCmd.Execute()

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-remove-a-property-definition-from-a-feature-class-tp4988878.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list