Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2003
    Posts
    4

    Unanswered: how to get source code of a procedure?

    Hi,

    Just wanted to know one thing.

    We have a procedures/function and triggers in Oracle. This is in a compiled format. i.e. we will not be able to view the function and it details.

    Is there any script/tool where we can get the source code of the procedures.

    Best Regards

    Thirumal

  2. #2
    Join Date
    Nov 2003
    Location
    Rotterdam, Netherlands
    Posts
    127
    Query the view DBA_SOURCE if u have dba priviliges
    or query USER_SOURCE from teh respective user.

    Regards

  3. #3
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up

    Hi,

    SELECT text
    FROM user_source
    WHERE name= '<Procedure_Name>'
    ;

    or

    SELECT text
    FROM all_source
    WHERE name= '<Procedure_Name>'
    ;
    SATHISH .

  4. #4
    Join Date
    Nov 2003
    Posts
    4
    Hi Satish,

    Thanks for the reply..

    The procedure is already in compiled format.. when i use those statements I am getting the compiled output.. I would like to see the source code .. any other statements / tools.

    Thanks

    Thirumal

  5. #5
    Join Date
    Nov 2003
    Location
    Rotterdam, Netherlands
    Posts
    127
    Hi tirumalai,

    The views DBA_SOURCE and USER_SOURCE contains the source in uncompiled format!!!
    The column TEXT will give u the actual text of the source.

    Regards

  6. #6
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up

    hi,

    The Query above will give U the Actual source code. what else You are trying to retrieve?
    SATHISH .

  7. #7
    Join Date
    Nov 2003
    Posts
    4
    Hi,
    After executing the statement follows the output. I am not able to see source code from it.

    SQL> SELECT text
    2 FROM all_source
    3 WHERE name='ADD_MEMBERSHIP';

    TEXT
    --------------------------------------------------------------------------------
    function add_membership wrapped
    0
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd

    TEXT
    --------------------------------------------------------------------------------
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    8
    200f000
    1
    4

    TEXT
    --------------------------------------------------------------------------------
    0
    2a
    8 FUNCTION:
    e ADD_MEMBERSHIP:
    15 PMEMBERSHIP_HEADER_ID:
    6 NUMBER:
    8 PNAME_ID:
    13 PMEMBERSHIP_CARD_NO:
    8 VARCHAR2:
    d PNAME_ON_CARD:
    9 PCOMMENTS:

    TEXT
    --------------------------------------------------------------------------------
    c PJOINED_DATE:
    4 DATE:
    10 PEXPIRATION_DATE:
    d PCRE

    Regards

    Thirumal

  8. #8
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    There is no way to "UNWRAP" a wrapped object - the point of wrapping is to protect source from prying eyes! You would need to have the original source file from which it was loaded.

  9. #9
    Join Date
    Nov 2003
    Posts
    4
    Hi Tony,

    In fact that procedure was written by one of our previous employee. But unfortunately we are not finding the source of that proc.

    Thanks for your time & Thanks to others who tried to help me.

    Best Regards

    Thirumal

  10. #10
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    I wonder why he/she wrapped it then? Maybe so you'd have to rehire him/her to make any changes!

Posting Permissions

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