Hello,
I am learning as I go ...
I want to make changes to an existing procedure. I want to round the numbers to 2 deciml places.
Example: TIMEDIFF shows up as 0.366666666666667
I want it to show up as 0.37
how do I go about to change that?
Also, after the change, I need to update this procedure. I use SQL plus to do that. How do I go about making the changes stick?
thanks for the help,
Ngai
=======================================================
PROCEDURE "LOGIN_LOGOUT" (sUserName varchar2, iIncidentId integer, iLoginId integer, sSessionId varchar2, iErrorCode out integer)
as
begin
iErrorCode := 2;
update cms_loginhist
set TIME_OUT=get_current_datetime(), TimeDiff=(TO_NUMBER(get_current_datetime()-Time_in))*24
where (LOGINID=iLoginId) and (USERNAME=sUserName) and (INCIDENT_ID=iIncidentId);
iErrorCode := 1;
if sSessionId != 'thick client' then
delete from cms_thinclients where (LOGINID=iLoginId) and (USERNAME=sUserName);
end if;
iErrorCode := 0;
end LOGIN_LOGOUT;
I am learning as I go ...
I want to make changes to an existing procedure. I want to round the numbers to 2 deciml places.
Example: TIMEDIFF shows up as 0.366666666666667
I want it to show up as 0.37
how do I go about to change that?
Also, after the change, I need to update this procedure. I use SQL plus to do that. How do I go about making the changes stick?
thanks for the help,
Ngai
=======================================================
PROCEDURE "LOGIN_LOGOUT" (sUserName varchar2, iIncidentId integer, iLoginId integer, sSessionId varchar2, iErrorCode out integer)
as
begin
iErrorCode := 2;
update cms_loginhist
set TIME_OUT=get_current_datetime(), TimeDiff=(TO_NUMBER(get_current_datetime()-Time_in))*24
where (LOGINID=iLoginId) and (USERNAME=sUserName) and (INCIDENT_ID=iIncidentId);
iErrorCode := 1;
if sSessionId != 'thick client' then
delete from cms_thinclients where (LOGINID=iLoginId) and (USERNAME=sUserName);
end if;
iErrorCode := 0;
end LOGIN_LOGOUT;