Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The equivalent of sp_helptext in Oracle??

5,300 views
Skip to first unread message

gamaz

unread,
Dec 3, 2002, 4:43:34 PM12/3/02
to
Hi,
I need to get the texts of all stored procedure, triggers and packages of
one user. What would
be the best way to handle this? I know in sql server, I used to use the
sp_helptext command.
Any help is appreciated in advance. Thanks.

Sybrand Bakker

unread,
Dec 3, 2002, 6:18:29 PM12/3/02
to

Refer to user_source.
I guess you consistently refuse to read manuals, do you?


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

Karsten Farrell

unread,
Dec 3, 2002, 7:09:52 PM12/3/02
to
In Oracle, use sqlplus. Of course, since all the SQL Server sp_whatever
are just stored procedures, you could write your own SPs in Oracle.

To get the text of all your stored procedures:

set echo off feedback off pause off pagesize 0 linesize 90
column text format a90 wrapped fold_before
select text
from user_source
where type = 'PROCEDURE'
order by name, line;
clear columns
set feedback on pagesize 24 linesize 80

To get the text of all your triggers:

set heading off echo off feedback off pause off pagesize 0 linesize 80
set long 100000 longchunksize 1000
column trigger_body format a80 wrapped fold_before
select 'Trigger: ' || trigger_name,
trigger_body
from user_triggers
order by trigger_name;
set feedback on pagesize 24
set long 80 longchunksize 80
clear columns

To get the text of all your packages:

set echo off feedback off pause off pagesize 0 linesize 90
column text format a90 wrapped fold_before
select text
from user_source
where type in ('PACKAGE', 'PACKAGE BODY')
order by name, type, line;
clear columns
set feedback on pagesize 24 linesize 80

gamaz

unread,
Dec 3, 2002, 7:46:42 PM12/3/02
to
Hey Sybrand,
Thanks for the help. I appreciate it.
"Sybrand Bakker" <gooid...@sybrandb.demon.nl> wrote in message
news:tsequusmk2nins8gq...@4ax.com...
0 new messages