question

OracleApprender avatar image
OracleApprender asked

How can you see the source code of the package ?

Is there any query to see the source code of a package ? Please let me know if any exists. Thank you in advance.

oraclemetadatadefinition
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KillerDBA avatar image
KillerDBA answered

Jonah Harris answered this question:

Here - OracleOverflow Q 65

Instead of 'VIEW', use the parameter 'PACKAGE':

SELECT DBMS_METADATA.GET_DDL('PACKAGE','<package_name>') FROM DUAL;

You will also want to fiddle with the max column size parameter. Example:

On PSOUG

Search for the GET_DDL method described there and note the use of:

'SET LONG <n>'

As you can see from my own answer to my own question, the path of least resistance is to get a decent Oracle coding tool. SQL Tools 1.5 is free and does the trick. You can look at all the definitions in your database using the object list browser.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

OracleApprender avatar image OracleApprender commented ·
Thank you for your answer...:)
0 Likes 0 ·
HillbillyToad avatar image
HillbillyToad answered

SELECT * FROM ALL_SOURCE WHERE (fill in the blank)

I'm not sure DBMS_METADATA is available for all versions of Oracle, but the source code should be available in that view for all versions.

Any decent IDE will also make the source available with a click...

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

OracleApprender avatar image OracleApprender commented ·
Thank you for your answer...:)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.