Declarative Objectivity (DO) Language : Schema Statements : UPDATE SCHEMA Statement
UPDATE SCHEMA Statement
An UPDATE SCHEMA statement modifies the schema of a federated database.   
Syntax 
updateSchemaStatement : UPDATE SCHEMA '{' (updateAction)+ '}'; 
updateAction : createClassClause | renameClassClause | alterClassClause | dropClassClause;
Quick Look 
Create two new schema classes that are subclasses of an existing schema class called FleetData.Vehicle:
UPDATE SCHEMA 
{
   CREATE CLASS FleetData.HybridVehicle SUPERCLASS FleetData.Vehicle
   {
     mpg : Integer {Encoding: Unsigned, Storage: B8},
     emissions : Real {Storage: B32},
     maxTripMiles : Integer {Encoding: Unsigned, Storage: B32},
     directCharge : Boolean
   }
 
   CREATE CLASS FleetData.GasVehicle SUPERCLASS FleetData.Vehicle
   {
     mpg : Integer {Encoding: Unsigned, Storage: B8},
     emissions : Real {Storage: B32},
     tankSize : Integer {Encoding: Unsigned, Storage: B8}
   }
}; 
Rename an existing schema class, and change multiple attributes within another schema class:
UPDATE SCHEMA 
{
   RENAME CLASS FleetData.EfficiencyReport TO FleetData.EfficiencySurvey
 
   ALTER CLASS FleetData.RentalCompany 
   {
     DROP temporary,
     ADD highVolumeDates2: List {Element: Date},
     RENAME corporateName TO name
   }
};
Delete an existing class from the schema (after deleting any existing objects of the class):
UPDATE SCHEMA 
{
   DROP CLASS FleetData.EfficiencyReportSurvey 
};
Discussion 
An UPDATE SCHEMA statement modifies the schema of a federated database as instructed by the statement’s updateAction clause or clauses.
You can use a single UPDATE SCHEMA statement to submit one or more update actions. Because even a single update action may be lengthy, you typically compose an UPDATE SCHEMA statement in a text file and submit it to the DO runner from a command line, instead of composing the statement at an interactive DO prompt.
When a single UPDATE SCHEMA statement includes multiple update actions, the requested updates are combined and reconciled with each other to produce a composite update that can be submitted to the federated database.
If the composite update is compatible with existing schema classes, the composite update is committed when the UPDATE SCHEMA statement returns. The return value Done indicates a successful commit.
If the composite update cannot validly be combined with existing schema classes, no updates are made, and the UPDATE SCHEMA statement returns an error message.
The order of update actions within an UPDATE SCHEMA statement does not matter, as long as they are compatible with each other.
Warning:If you plan to delete a class, it is strongly recommended that you first delete all objects of that class from the federated database. Objects of the class become inaccessible after the class is deleted from the schema.
You can use an UPDATE SCHEMA statement to create a class that depends on another class—for example, one class may inherit from the other, or define an attribute that references or embeds the other. The specified superclass, referenced class, or embeddable class must already exist in the schema. Otherwise, you must create that class along with the dependent class by including another update action in the same UPDATE SCHEMA statement.