Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 | 

Dropping a Superclass

Description

Deleting a superclass from a class means removing the relationship between two classes. If a superclass is deleted from a class, it changes inheritance relationship of the classes as well as of all their subclasses.

Syntax

ALTER [ class_type ] class_name
DROP SUPERCLASS class_name [ { , class_name }_ ]
[ INHERIT resolution [ {, resolution }_ ] ] [ ; ]

resolution:
[ CLASS ] attr_mthd_name OF superclass_name [ AS alias ]

For the first class_name, specify the name of the class to be modified. For the second class_name, specify the name of the superclass to be deleted. If a name conflict occurs after deleting a superclass, see the Resolving Class Conflict section for the resolution.

Example
  • Example 1
  • In the following example, the female_event class inherits from the event class.

CREATE CLASS female_event UNDER event;

  • Example 2
  • In the following example, the ALTER statement deletes the event superclass from the female_event class. The attributes that the female_event class inherited from the event class do not exist any more.

ALTER CLASS female_event
DROP SUPERCLASS event;