Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    2

    Unanswered: 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

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    SELECT Text
    FROM SYS.DBA_SOURCE
    WHERE TYPE = 'PACKAGE BODY'
    AND OWNER = package_owner
    AND NAME = package_name
    ORDER BY LINE
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    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.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •