Home  >  Article  >  Database  >  Drop function in oracle

Drop function in oracle

下次还敢
下次还敢Original
2024-05-08 20:00:25520browse

The DROP command in Oracle can delete database objects (tables, views, indexes, triggers). This command cannot be reversed and will delete all dependent objects. Usage: DROP ;Object types include TABLE, VIEW, INDEX, and TRIGGER. Use the CASCADE keyword to cascade the deletion of dependent objects.

Drop function in oracle

The role of DROP command in Oracle

The DROP command is used to delete database objects, such as tables, from the Oracle database , views, indexes and triggers.

Usage

<code>DROP <对象类型> <对象名称>;</code>

Object Type

  • TABLE: Delete table.
  • VIEW: Delete the view.
  • INDEX: Delete index.
  • TRIGGER: Delete trigger.

Explanation

  • The DROP command is irreversible, and the deleted objects cannot be recovered.
  • The DROP command will also delete all dependent objects associated with the object.
  • Use the CASCADE keyword to cascade deleted dependent objects.
  • If the object is in use, it cannot be deleted.

Example

Delete the table named "customers":

<code>DROP TABLE customers;</code>

Delete the table named View of "customer_view":

<code>DROP VIEW customer_view;</code>

Delete the index named "customer_idx":

<code>DROP INDEX customer_idx;</code>

Cascade delete named "customer_trigger" Triggers and their dependent objects:

<code>DROP TRIGGER customer_trigger CASCADE;</code>

The above is the detailed content of Drop function in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:interval usage in oracleNext article:interval usage in oracle