DROP statements
Derby Reference Manual
54
in the WHERE clause. A CREATE or DROP INDEX statement for the target table of a
prepared searched delete statement invalidates the prepared searched delete statement.
The positioned delete statement depends on the cursor and any tables the cursor
references. You can compile a positioned delete even if the cursor has not been opened
yet. However, removing the open cursor with the JDBC close method invalidates the
positioned delete.
A CREATE or DROP INDEX statement for the target table of a prepared positioned
delete invalidates the prepared positioned delete statement.
DROP statements
Use DROP statements to remove functions, indexes, procedures, roles, schemas,
synonyms, tables, triggers, and views.
DROP FUNCTION statement
Syntax
DROP FUNCTION function-name
Identifies the particular function to be dropped, and is valid only if there is exactly one
function instance with the function-name in the schema. The identified function can have
any number of parameters defined for it.
An error will occur in any of the following circumstances:
· If no function with the indicated name exists in the named or implied schema (the
error is SQLSTATE 42704)
· If there is more than one specific instance of the function in the named or implied
schema
· If you try to drop a user-defined function that is invoked in the generation-clause of
a generated column
· If you try to drop a user-defined function that is invoked in a view
DROP INDEX statement
DROP INDEX removes the specified index.
Syntax
Examples
DROP INDEX OrigIndex
DROP INDEX DestIndex
Statement dependency system
If there is an open cursor on the table from which the index is dropped, the DROP INDEX
statement generates an error and does not drop the index. Otherwise, statements that
depend on the index's table are invalidated.
DROP PROCEDURE statement
Syntax
DROP PROCEDURE
procedure-Name
Identifies the particular procedure to be dropped, and is valid only if there is exactly one
procedure instance with the procedure-name in the schema. The identified procedure can
have any number of parameters defined for it. If no procedure with the indicated name in