If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > View stored procedure source code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-12, 03:21
Subasish Subasish is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
View stored procedure source code

Hi

What d query to see the source code of stored procedure contained inside a package in oracle?

Thanks and regards
Subasish
Reply With Quote
  #2 (permalink)  
Old 01-13-12, 03:43
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
SELECT Text
FROM SYS.DBA_SOURCE
WHERE TYPE = 'PACKAGE BODY'
AND OWNER = package_owner
AND NAME = package_name
ORDER BY LINE
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #3 (permalink)  
Old 01-13-12, 05:04
Subasish Subasish is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
View stored procedure source code

Thanks for the reply aflorin27, but I want to see the text of the Stored procedure defined inside a particular package. All info I have is, the stored procedure and package name.
Reply With Quote
  #4 (permalink)  
Old 01-13-12, 05:26
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
Did you try to run a query Florin posted? If you can't access DBA_SOURCE, you need to acquire privileges to do so. Or, if a package is located in a schema you have access to, you could use USER_SOURCE instead.

Because, it runs perfectly well.
Code:
SQL> SELECT Text
  2   FROM USER_SOURCE
  3   WHERE TYPE = 'PACKAGE BODY'
  4   AND NAME = 'PKG_DEGIS'
  5   ORDER BY LINE;

TEXT
----------------------------------------------
package body       pkg_degis as

  function f_dg_admin (par_user in char)
    return boolean
  is
<snip>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On