Get code from user_source table : user_source « System Tables Views « Oracle PL / SQL






Get code from user_source table

  

SQL>
SQL> prompt set define off
set define off
SQL> select decode( type||'-'||to_char(line,'fm99999'),
  2                 'PACKAGE BODY-1', '/'||chr(10),
  3                  null) ||
  4         decode(line,1,'create or replace ', '' ) ||
  5         text text
  6    from user_source
  7   where name = upper('&1')
  8   order by type, line;
Enter value for 1: prompt /
SQL> prompt set define on
set define on
SQL>
SQL> set feedback on
SQL> set heading on
SQL> set termout on
SQL> set linesize 100
SQL>

   
  








Related examples in the same category

1.Query user_source table for a stored procedure name and procedure type
2.Check user procedure status and text