Results 1 to 4 of 4
  1. #1
    Join Date
    May 2002
    Posts
    62

    Question Unanswered: How to extract the text of a stored procedure

    Hi,

    Does any one have a Unix shell script to extract the text of a stored procedure from Oracle 8i/9i database and write it to a flat file on Unix machine so that I can compile that on another server using FTP ?

    Any help is really appreciated.

    Thanx..
    -Bheemsen

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SELECT TEXT
    FROM USER_SOURCE
    WHERE NAME = <PROCEDURE|PACKAGE|ETC>
    ORDER BY LINE;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2003
    Location
    Bangalore
    Posts
    44

    Re: How to extract the text of a stored procedure

    Originally posted by bheemsen
    Hi,

    Does any one have a Unix shell script to extract the text of a stored procedure from Oracle 8i/9i database and write it to a flat file on Unix machine so that I can compile that on another server using FTP ?

    Any help is really appreciated.

    Thanx..
    -Bheemsen
    Here is the script, I hope this may help u.

    sqlplus scott/tiger << EOL
    Set Head off
    Set pau off
    spool procedure.txt
    SELECT text
    FROM user_source
    WHERE name = '<PROCEDURE NAME|PACKAGE NAME|ETC>'
    ORDER BY line;
    spool off
    exit;
    EOL

  4. #4
    Join Date
    May 2002
    Posts
    62
    Thank you mahesh_bk1 and anacedent for your kind responses. The replies really helped me.

    -Bheemsen

Posting Permissions

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