|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jdc.lang.Object
|
+--com.jdc.rdb.sql.SQL
|
+--com.jdc.rdb.sql.ddl.DDL
|
+--com.jdc.rdb.sql.ddl.drop.Drop
Drop represents a Data Definition Language DROP
SQL statement. The Drop statement deletes or
removes an object from the Database. Any objects that are directly or
indirectly dependent on that object are either deleted or made inoperative.
Whenever an object is deleted, its description is deleted from the catalog and any
packages that reference the object are invalidated. Valid database objects are
SCHEMA, TABLE, VIEW, and INDEX.
SCHEMA, this SQL statement drops
the specified Schema. A schema may only be dropped only
if it contains no tables. The SYS_INFO and APP
schemas may not be dropped.
If the object is of type TABLE, this SQL statement drops
the specified Table from the database. The IF EXISTS
clause (extension of the ANSI SQL-92 standard) will drop
the table only if it exists. If this clause is not present, an error
is returned if the table does not exist. Any data that exists in a dropped
table is lost.
If the object is of type VIEW, this SQL statement drops
the specified View from the database. A view can be changed by
dropping and recreating it.
SQL statements. It is an executable statement
that may be dynamically prepared.ID of the
DROP statement when dropping objects that allow two-part names must
include one of the following or an error will result:SYSADM or DBADM authorityDROPIN privilege on the schema for the objectDEFINER column of the catalog view for the objectCONTROL privilege on the object (applicable only to indexes, tables, and views)ID of the DROP statement when
dropping a table or view hierarchy must hold one of the above privileges for each
of the tables or views in the hierarchy.ID of the DROP statement when dropping a
schema must have SYSADM or DBADM authority or be the
schema owner as recorded in the OWNER column of SYSCAT.SCHEMATA.
Drop drop = new Drop(table);
DropStatus status = drop.execute();
if (status.isSuccessful())
{
// Drop success
}
else
{
// Drop failed!
}Drop of a multiple tables at one time is not supported.Drop of a View or Index is not currently supported.
Schema,
Table,
,
Impact,
Serialized Form| Field Summary | |
static String |
COMMAND
The Drop statement command keyword. |
| Fields inherited from class com.jdc.rdb.sql.ddl.DDL |
sql |
| Fields inherited from class com.jdc.lang.Object |
string |
| Constructor Summary | |
Drop()
Constructs a new Drop statement object. |
|
Drop(Schema schema)
Constructs a new Drop statement object for the specified
Database Schema definition. |
|
Drop(String statement)
Constructs a new Drop statement object for the specified
SQL String. |
|
Drop(Table table)
Constructs a new Drop statement object for the specified
Database Table definition. |
|
| Method Summary | |
DropStatus |
execute()
Executes the Drop statement and returns
a DropStatus object. |
Impact |
getImpact()
Returns the Impact clause for this
Drop statement. |
Drop |
set(DropClause clause)
Sets a DropClause for this Drop statement. |
Drop |
setCascade()
Adds the optional CASCADE keyword to the Drop
statement. |
Drop |
setRestrict()
Adds the optional RESTRICT keyword to the Drop
statement. |
| Methods inherited from class com.jdc.rdb.sql.ddl.DDL |
finalize, getConnection, getDatabase, getObject, isValid, setObject |
| Methods inherited from class com.jdc.rdb.sql.SQL |
addClause, execute, getClause, getCommand, getStatement, setCommand, setConnection, setStatement, toString |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String COMMAND
Drop statement command keyword.
| Constructor Detail |
public Drop()
Drop statement object.
public Drop(Schema schema)
Drop statement object for the specified
Database Schema definition.
SQLInvalidException - No schema definition is specified.public Drop(Table table)
Drop statement object for the specified
Database Table definition.
SQLInvalidException - No table definition is specified.public Drop(String statement)
Drop statement object for the specified
SQL String. If you specify a
custom SQL String, you must also specify
a Database Connection to use.
SQLInvalidException - No DROP statement is specified.SQL.setConnection(java.sql.Connection)| Method Detail |
public DropStatus execute()
Drop statement and returns
a DropStatus object.
Drop statement status.public Impact getImpact()
Impact clause for this
Drop statement. The Impact clause may be blank
or CASCADE or RESTRICT.
Drop statement Impact clause.setCascade(),
setRestrict()public Drop set(DropClause clause)
DropClause for this Drop statement. Use
this method to specify a custom Drop clause.
Drop statement object.
SQLInvalidException - No DROP statement clause is specified.public Drop setCascade()
CASCADE keyword to the Drop
statement. This keyword results in the statement dropping all database objects
that depend upon the object to be dropped
Drop statement object.setRestrict()public Drop setRestrict()
RESTRICT keyword to the Drop
statement. This keyword results in the statement not dropping the
database object if one or more dependent objects exist.
Drop statement object.setCascade()
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||