Drop Table processing
- Last Updated: May 12, 2026
- 1 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
The SQL syntax to drop a table is:
DROP TABLE table-name [drop-option];
drop-option = CASCADE | RESTRICT
When a SQL query of this form is issued, OpenAccess SDK SQL engine maps this information to a list of schema objects of type damobj_table. When the DDL function in the IP is called, the DDL function should perform the following steps:
-
Get information about the table (name, owner, qualifier)
pList =
dam_getSchemaObjectList(hstmt, DAMOBJ_TYPE_TABLE);damobj_table pTableObj = getFirstSchemaObject(pList);
-
Get foreign keys information to check the optional drop-option in the delete_rule (DAM_CASCADE | DAM_RESTRICT).
pList = dam_getSchemaObjectList(hstmt, DAMOBJ_TYPE_FKEY);damobj_stat pFkeyObj = getFirstSchemaObject(pList); -
Use this information to drop the table.