Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to count the usage of a SQL function?
Steven Joshua wrote:
>
> Hello, List:
>
> We have more than 100 triggers in the database. Some
> of them use ORACLE NEW_TIME function in the code. Is
> there a way that we can count how many triggers are
> referencing NEW_TIME function?
>
> I used below query, but it will only count the
> function that we created in the database. how can can
> count SQL function (NEW_TIME)?
>
> Select Count(*) From USER_DEPENDENCIES
> Where Type in ('PROCEDURE', 'TRIGGER')
> And REFERENCED_TYPE = 'FUNCTION'
> And REFERENCED_NAME = 'TIME_CONVERT'
>
> Thanks a lot
>
> Steven
>
Write a PL/SQL block which fetches column TRIGGER_BODY fro DBA_TRIGGERS into a VARCHAR2(32767) and loop on this result until instr(upper(substr(large_string, current_pos)), 'NEW_TIME') returns 0. Brute force.
-- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: sfaroult_at_oriole.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed May 08 2002 - 04:33:18 CDT