Hi
I created the following code to show the code in my stored procedures:
set serveroutput ON
set feedback off
set linesize 200
set ver off
col name format A100 Heading 'List of Stored Procedures'
PROMPT
-- Show the list of stored procedures for the user name
SELECT distinct name
FROM User_Source
WHERE type = 'PROCEDURE'
Order by name;
col text format A200 Heading 'Code'
PROMPT
PROMPT
--Show the code for the stored procedure chosen
select
Text
from user_source
where
name = upper('&Stored_Procedure')
and type = 'PROCEDURE'
order by
Line;
PROMPT
-----------------------------------------------------------------
The above code shows a list of stored procedures. Then it prompts for the stored procedure name. Then it will show the code for that stored procedure.
I would like to improve this. I would like to include a row number when showing the list of stored procedures. Then choose the stored procedure by entering a number.
e.g
List of Stored Procedures
-----------------------------
1 SP1
2 SP2
S SP3
Enter value for Stored Procedure: 1
Code
----------------------------------
select column
from Table
Does any one know how to do this?
Regards
Mark
I created the following code to show the code in my stored procedures:
set serveroutput ON
set feedback off
set linesize 200
set ver off
col name format A100 Heading 'List of Stored Procedures'
PROMPT
-- Show the list of stored procedures for the user name
SELECT distinct name
FROM User_Source
WHERE type = 'PROCEDURE'
Order by name;
col text format A200 Heading 'Code'
PROMPT
PROMPT
--Show the code for the stored procedure chosen
select
Text
from user_source
where
name = upper('&Stored_Procedure')
and type = 'PROCEDURE'
order by
Line;
PROMPT
-----------------------------------------------------------------
The above code shows a list of stored procedures. Then it prompts for the stored procedure name. Then it will show the code for that stored procedure.
I would like to improve this. I would like to include a row number when showing the list of stored procedures. Then choose the stored procedure by entering a number.
e.g
List of Stored Procedures
-----------------------------
1 SP1
2 SP2
S SP3
Enter value for Stored Procedure: 1
Code
----------------------------------
select column
from Table
Does any one know how to do this?
Regards
Mark