get procedure info in spl
Posted in 1999
I have a few questions for the experts out there...
What I need to do - within a stored procedure - is delete another stored
procedure if it is not currently in use, or hasn't been in use recently,
or was created before a certain time...
Sooo - I need to be able to get any of the following info about another
stored procedure from within a stored procedure (listed in order of
preference...)
1. If the particular stored procedure is currently being executed
2. When the particular procedure was executed last
3. When the particular procedure was created
4. Any information along these same lines....
I have already looked at the 'created' field in sysprocplan but it is
only precise to the day - I need it at least to the minute...second
preferably. In exploring the other system tables I managed to come up
with the following query that I believe tells yields the entries in
procedure cache for procedures created by the user who owns the current
session:
select distinct sp.prc_dbname, sp.prc_ownername, sp.prc_name
from sysmaster:sysprc sp, sysmaster:syssessions ss
where ss.username = sp.prc_ownername
and ss.username =
(select distinct username from sysmaster:syssessions
where sid = dbinfo('sessionid')) ;
I haven't been able to find any doco about sysmaster:sysprc - can anyone
enlighten me or point me to a source of doco? Also - when and for how
long are procedures held in procedure cache - would I be able to use any
of this info to determine if a procedure has been in use in the recent
past?
Any other suggestions on how/where I can get any of the desired info?
Thank You,
Nicole Guffey
nguffey@jdriscoll.com