Click to See Complete Forum and Search --> : how to get the procedure text from PL/SQL prompt


kvwarun
December 5th, 2007, 02:23 PM
hi friends,

is there any option to retrieve procedure text from PL/SQL prompt? you can access the procedure or trigger text using SP_HELPTEXT command in SQL Server. but in oracle PL/SQL, i couldn't find a command for that. however we can access the same through GUI tools which has been provided along with oracle.

davide++
December 6th, 2007, 03:41 AM
Hi all.

You can query the ALL_SOURCE table; for example


SELECT TEXT
FROM ALL_SOURCE
WHERE NAME = 'BUTTA_PROCESSO'


extracts the code of stored procedure BUTTA_PROCESSO: each row of the query is a code row of the procedure.

raghu_mk
December 6th, 2007, 08:57 AM
Select Text
From All_source
Where Name = 'butta_processo'
Order By Line

olivthill
December 7th, 2007, 08:20 AM
The default sizes for display may not suit you. Here is what I do to see triggers:SET LINESIZE 132
SET LONG 4000
SELECT TRIGGER_BODY from user_triggers where trigger_name = 'FOO_TRIGGER'