1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

how to getback a procedure

Discussion in 'SQL PL/SQL' started by kishore garlapati, Oct 19, 2010.

  1. kishore garlapati

    kishore garlapati Active Member

    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    110
    Hi Sir,
    I would like to know,how to get back a procedure from DB
    and with which command edit the procedure
    I am tried with the following for getting back a procedure and editable
    select text from user_source where name like 'object_name';
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    This is precisely why the DBMS_METADATA.GET_DDL function exists:

    Code (SQL):
     
    SET long 100000
     
    SELECT dbms_metadata.get_ddl('PROCEDURE','<name of procedure>','<owner>')
    FROM dual;
     
     
    Fill in the missing pieces, spool the output to a file.