Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the deletion syntax of database package and package body

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to understand the deletion syntax of database package and package body". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to understand the deletion syntax of database packages and package bodies.

I created this gadget program to display the status of a specified object:

CREATE OR REPLACE PROCEDURE plch_show_status (object_name_in IN VARCHAR2, type_in IN VARCHAR2) IS l_status user_objects.status%TYPE;BEGIN SELECT ob.status INTO l_status FROM user_objects ob WHERE object_name = object_name_in AND object_type = type_in; DBMS_OUTPUT.put_line (type_in | |''| | object_name_in | |':'| | l_status) EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.put_line (type_in | |''| | object_name_in | |': UNDEFINED'); END;/

I created this package again:

CREATE OR REPLACE PACKAGE plch_pkgIS PROCEDURE do_stuff;END;/CREATE OR REPLACE PACKAGE BODY plch_pkgIS PROCEDURE do_stuff IS BEGIN NULL; END;END;/

I execute this block after executing the statements in the following options:

BEGIN plch_show_status ('PLCH_PKG',' PACKAGE'); plch_show_status ('PLCH_PKG',' PACKAGE BODY'); END;/

Which options produce these two lines of output?

PACKAGE PLCH_PKG: UNDEFINEDPACKAGE BODY PLCH_PKG: UNDEFINED

(A)

DROP PACKAGE SPECIFICATION plch_pkg/DROP PACKAGE BODY plch_pkg/SQL > DROP PACKAGE SPECIFICATION plch_pkg 2 / DROP PACKAGE SPECIFICATION plch_pkgORA-00933: the SQL command did not end correctly SQL > DROP PACKAGE BODY plch_pkg 2 / Package body droppedSQL > SQL > BEGIN 2 plch_show_status ('PLCH_PKG',' PACKAGE'); 3 plch_show_status ('PLCH_PKG',' PACKAGE BODY'); 4 END; 5 / PACKAGE PLCH_PKG: VALIDPACKAGE BODY PLCH_PKG: UNDEFINEDPL/SQL procedure successfully completedSQL >

(B)

DROP PACKAGE plch_pkg/DROP PACKAGE BODY plch_pkg/SQL > DROP PACKAGE plch_pkg 2 / Package droppedSQL > DROP PACKAGE BODY plch_pkg 2 / DROP PACKAGE BODY plch_pkgORA-04043: object PLCH_PKG does not exist SQL > BEGIN 2 plch_show_status ('PLCH_PKG',' PACKAGE'); 3 plch_show_status ('PLCH_PKG',' PACKAGE BODY'); 4 END; 5 / PACKAGE PLCH_PKG: UNDEFINEDPACKAGE BODY PLCH_PKG: UNDEFINEDPL/SQL procedure successfully completedSQL >

(C)

DROP PACKAGE SPECIFICATION AND BODY plch_pkg/SQL > DROP PACKAGE SPECIFICATION AND BODY plch_pkg 2 / DROP PACKAGE SPECIFICATION AND BODY plch_pkgORA-00933: the SQL command did not end correctly SQL > BEGIN 2 plch_show_status ('PLCH_PKG',' PACKAGE'); 3 plch_show_status ('PLCH_PKG',' PACKAGE BODY'); 4 END; 5 / PACKAGE PLCH_PKG: VALIDPACKAGE BODY PLCH_PKG: VALIDPL/SQL procedure successfully completedSQL >

(D)

DROP PACKAGE plch_pkg/SQL > DROP PACKAGE plch_pkg 2 / Package droppedSQL > SQL > SQL > BEGIN 2 plch_show_status ('PLCH_PKG',' PACKAGE'); 3 plch_show_status ('PLCH_PKG',' PACKAGE BODY'); 4 END; 5 / PACKAGE PLCH_PKG: UNDEFINEDPACKAGE BODY PLCH_PKG: UNDEFINEDPL/SQL procedure successfully completedSQL >

Answer BD

At this point, I believe you have a deeper understanding of "how to understand the deletion syntax of database packages and packages". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report