Statistical report: User login (platform clicks) The number of landing times, number of login accounts and total number of accounts in the first one months of the month before the monthly scheduled task statistics.
Use stored procedures to store the values of the query in table Rp_month_click.
Create or replace procedure Update_rp_month_click as--defines the variable Date_v varchar (6); --year login_count_v INTEGER; --Login Count Login_accoun_count_v INTEGER; --Login account number Accoun_count_v INTEGER; --Total number of accounts begin//------------------Get parameters Assign value to variable start---------------------*/--date To_char (sysdate-1, ' yyyymm ') =to_char (sysdate, ' yyyymm ') then To_char (sysdate, ' yyyymm ') Else To_char (sysdate-1, ' Yyyym M ') end into date_v from dual; --Number of Logins select COUNT (t.log_id) to login_count_v from Sc_act_log t where T.act_type = 5 and To_date (To_char (t. Act_time, ' yyyymm '), ' yyyymm ') = To_date (To_char (sysdate, ' yyyymm '), ' yyyymm '); --Login Number Select COUNT (staff_id) to Login_accoun_count_v from (select t.staff_id from Sc_act_log t where T.act_type = 5 and To_date (To_char (t.act_time, ' yyyymm '), ' yyyymm ') = To_date (To_char (sysdate, ' yyyymm '), ' yyyymm ') Group by t.staff_id); --Total number of Accounts select COUNT (t.staff_id) to accoun_count_v from Hrm_staff t where t.status = 1; /*------------------Get the parameter end---------------------*/--First delete the delete from Rp_month_click where rmonth = Date_v; --Add INSERT into Rp_month_click (ID, Rmonth,login_count,login_account_count,account_count) VALUES (seq_sc_global_p Arameters. NEXTVAL,DATE_V,LOGIN_COUNT_V,LOGIN_ACCOUN_COUNT_V,ACCOUN_COUNT_V); Commit End
ORACLE stored procedure instances [memo]