Oracle 10g administration stored procedures - query the database view. Stored procedures. Functions

2010-12-08  来源:本站原创  分类:Database  人气:54 

Database dictionary view used to display the current user user_objects all the objects contained. It not only can be used to list the user tables, views, indexes, etc., can also be used to list the user's stored procedures, functions, packages.

- 1, query the database views, stored procedures, functions

select object_name,created,status
from user_objects
where object_type in ('PROCEDURE','FUNCTION','VIEW')

- 2, view the source code for stored procedures
- When a stored procedure is established, oracle will process name, source machine to execute code stored in the data dictionary. We can view the current user by querying urser_source all stored procedures, the process name needs to be capitalized

select text from user_source where name = 'ADD_DEPT';

1 "procedure add_dept"
2 "(dno number, dname varchar2 default null, loc varchar2 default null)"
3 "is"
4 "begin"
5 "insert into dept values ​​(dno, dname, loc);"
6 "exception"
7 "when dup_val_on_index then"
8 "raise_application_error (-2000, 'the department number can not repeat');"
9 "end;"

相关文章