Such as:
Description: the stored procedure fragment
- step1 cursor loop
The begin
Declare v_dic_code varchar (50);
Declare v_dic_name varchar (50);
Declare v_num int.
- a statement cur1
Declare cur1 cursor for
The select DIC_CODE, DIC_NAME from S_PB_sysdicinfo where (PDIC_CODE LIKE 'X1001 %' OR PDIC_CODE LIKE 'X1002 %'); - check the type
The open cur1;
The fetch cur1 into v_dic_code v_dic_name;
While (SQLCODE=0) do
-- the step2 number
Select
Count (1)
Into
V_num
The from C_SM_HDINFO sm01
Where 1=1
And sm01. IS_ACTIVE='1'
And sm01. Hd_type_self=v_dic_code
And the left (CHECK_DATE, 4)=v_current_year
;
- insert the rs
Insert into the session. Tmp_tab1 (hd_type_self hd_type_self_name, num)
Values (v_dic_code v_dic_name, v_num);
The fetch cur1 into v_dic_code v_dic_name;
End the while;
The close cur1;
end;
The toad debugging process resulting in abnormal service closed!
Question 1: the stored procedure how to lead to abnormal shutdown service? What are the causes and conditions? Also please you love