Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: tuning query with concat string.
Hi
select max(start_time) from fm_audit_form where ws_id =
'S'||userenv('SESSIONID')
I'm not sure if you really need to do it, and I'm telling you if oracle execute several times the userenv('SESSIONID') causing and additional work, more than once in the session.
But if the userenv('SESSIONID') is executing several times in the query and/or session. Then you cound put in a package set once (because your sessiont id will not change in your session and use that package variable.
create package x
nSessionID number;
end;
create package body x
is
begin
nSessionID = userenv('SESSIONID');
end;
This is the idea the first time you try to read this variable, it will execute the "query", after that, only will read the variable value
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Mar 21 2006 - 10:11:18 CST
![]() |
![]() |