Delete, Remove or Drop Oracle Stored Packages with Drop Package

Oracle Package is an object in Oracle database that allows developers and designers to group procedures and functions into common groups, typically based upon their functionality. Package can be treated as the container for functions and procedures. A package consists of two sections which is the package specification (export script file will be in .pks extension) which must be declared first and contains a definition of any objects that can be referenced from outside of the package. The other section is a package body (export SQL script file will be in .pkb extension) that contains the implementation of the objects or stored procedures within the package. With package, a procedure can be hidden inside the package by not declaring them in the package specification.

At same time you may no longer need a package, and wish to remove, delete, or drop the package from the Oracle database. To do so, simply use the DROP PACKAGE SQL command statement from SQL*Plus or Toad or other database too to drop a stored package.

Syntax of the Drop Package

DROP PACKAGE [BODY] [schema.]package_name;

The optional BODY parameter is specified when you want to drop only the body of the package. If this option is omitted, Oracle drops both the body and specification of the package. If the package to drop is in your own schema, then there is no need to specify the scheme containing the package too, else you will need to put in the appropriate schema name. Beside, you must have the DROP ANY PROCEDURE system privilege too.

Note: Do not use this statement to remove a single object from a package. Instead, re-create the package without the object using the CREATE PACKAGE and CREATE PACKAGE BODY SQL statements, or by using the SQL command with the OR REPLACE clause.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.

New Articles

Incoming Search Terms for the Article

drop package oracle - oracle drop package - delete package oracle - oracle delete package - drop package in oracle - how to drop a package in oracle - drop object in oracle - drop objects in oracle - oracle drop object - drop object oracle - oracle rename package - drop oracle package - how to drop object in oracle - oracle suppression package - how to drop package in oracle - drop package - view the public portions of the APPLICATION_DELETE package - oracle remove package - Which one of the following statements allows you to view the public portions of the APPLICATION_DELETE package? - APPLICATION_DELETE package - delete oracle package - ORACLE DELETE OBJECT - remove package oracle - drop objects oracle - what's a package in oracle and how to drop - disable oracle package - Which one of the following statements allows you to view the public portions of the APPLICATION_DELETE package - delete package in oracle - borrar package oracle - oracle sql remove package - drop package oracle sql - drop a package in oracle - how to drop oracle package - oracle drop all packages - APPLICATION_DELETE oracle - drop packages - drop all procedures oracle - how to delete a procedure in oracle - script to drop a package without dropping tables - how to view the public portions of the APPLICATION_DELETE package - drop oracle object - how to delete a package in oracle - How to recover package from Oracle Toad - oracle drop package command - recreating dropped packages - remove Oracle procedures from package - all - application_delete package in oracle - Application_Delete public portion - ORACLE DROP STORED PROCEDURE -