Tuesday, August 25, 2009

Recent Developments Of Empysema

Package

To see the body of our package we have to check first that we installed version of Oracle.

If it is equal to or later versions to exploit the package just nine native dbms_metadata. With this query we get what we want:

SQL> select dbms_metadata.get_ddl ('PACKAGE', '') from dual;

If we need to versions prior to nine use tables all_source:

SQL> desc all_source;
Name Null?
Type --------------------------------- -------- ---- ---------------------------------------------
OWNER VARCHAR2 (30)
NAME VARCHAR2 (30)
TYPE VARCHAR2 (12)
LINE NUMBER
TEXT VARCHAR2 (4000)

and make this query if you want the definition of the package:

SELECT text FROM
all_source
WHERE owner = 'OWNER_PACKAGE '
AND name = 'NOME_PACKAGE ' AND type =
'PACKAGE' ORDER BY
type, line;

and this also if you want the body:

SELECT text FROM
all_source
WHERE owner = 'OWNER_PACKAGE' AND name =
'NOME_PACKAGE'
AND type = 'PACKAGE BODY' ORDER BY
type, line;


You can look at the description of the package simply laciando function desc:

SQL> desc OWNER_PACKAGE.NOME_PACKAGE;

0 comments:

Post a Comment