Extract any procedure, function or package : DECODE « Conversion Functions « Oracle PL / SQL






Extract any procedure, function or package

   
SQL> --
SQL>
SQL>
SQL>
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('Your PackageName')
  8   order by type, line;

no rows selected

SQL>
SQL>
SQL> --

   
    
  








Related examples in the same category

1.Syntax: DECODE
2.Decode char value to number
3.Decode statement could be easily rewritten using the CASE statement
4.Decode for more than one key value pair
5.Use Decode as if statement to logic like 'if then else'
6.DECODE and GROUPING
7.Create a report that shows number of customers per state.
8.Use DECODE and SIGN functions on the ORD table
9.Decode the result from row_number over, partition by, order by
10.Decode a column with substr and instr
11.DECODE and substr function
12.Format nullable heading
13.DECODE in the GROUP BY clause
14.Demo range comparison with DECODE
15.Use decode as if statement and output 'high' or 'low'
16.Use decode create dynamic select statement
17.decode column data to output more meaningful information