Re: Table containing names of stored procs, triggers?

From: Lothar Armbruester <lothar.armbruester_at_rheingau.netsurf.de>
Date: 1997/12/12
Message-ID: <1470.285T1857T12554432_at_rheingau.netsurf.de>#1/1


robsoft schrieb am 11-Dez-97 17:08:42
zum Thema "Table containing names of stored procs, triggers?":
>Can somebody tell me how I would go about finding out what triggers and
>stored procedures/functions are installed on a given database?
 

>I'm writing some code that needs to check that various updates to the
>database have been made before it can be run - so I want to be able to
>verify, for instance, that trigger 'AddStockToTotal' is installed, and
>that for instance function 'ApplyHalfLifeToStock' is installed.
 

>I'm sure that there must be a system table that contains a list of names
>(and maybe the definitions?) for this kind of thing - what's it called?
 

>Any help would be gratefully received!

The triggers can be looked for in USER_TRIGGERS or (I think) in ALL_TRIGGERS. For stored procedures, you could do something like

select owner from all_objects
where object_type = 'FUNCTION'
and object_name='ApplyHalfLifeToStock';

(Maybe object_type must be replaced by type!  As I'm writing this at home, I have no Oracle to check.  Use descrive all_objects :-)

Eventually you would prefer user_objects.

If you want to get the definition of the function, you should have a look on all_source or user_source.

>rob_at_xxrobsoft.compulink.co.uk
>(remove the xx for my email address)

Hope that helps,
Lothar

--
Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |
Received on Fri Dec 12 1997 - 00:00:00 CET

Original text of this message