Home > database > Open cursor for SQL to lack expression?
Open cursor for SQL to lack expression?
Time:09-26
I write when executed smoothly through the process of storage, call times lack expression, beg god to see what's going on?
The create or replace procedure get_form_data (p_date varchar2, str1 varchar2, str2 varchar2, str3 varchar2, str4 varchar2, str5 varchar2) IS
T_date date; T_dept varchar2 (36); T_identity varchar2 (36); T_charge varchar2 (36); T_operator varchar2 (36); T_type varchar2 (36); T_time varchar2 (36); T_outp number (6, 2); T_emer number (6, 2); T_daytimeoutp number (6, 2); T_daytimeemer number (6, 2); T_night number (6, 2); T_holidayoutp number (6, 2); T_holidayemer number (6, 2); T_export number (6, 2); T_regist number (6, 2); CUR1 SYS_REFCURSOR; Sql_statement varchar2 (3000) :='select dim_date,' | | str1 | | ', '| | str2 | |', '| | str3 | |', '| | str4 | |', '| | str5 | |', the sum (t.o utp_nums) OUPT_NUMS, sum (emer_nums) emer_nums, The sum (daytime_outp_nums daytime_outp_nums), sum (daytime_emer_nums) daytime_emer_nums, The SUM (NIGHT_OUTP_NUMS NIGHT_OUTP_NUMS), SUM (HOLIDAY_OUTP_NUMS HOLIDAY_OUTP_NUMS), SUM (HOLIDAY_EMER_NUMS) HOLIDAY_EMER_NUMS, SUM (EXPORT_OUTP_NUMS) EXPORT_OUTP_NUMS, The SUM (REGIST_CHARGES) REGIST_CHARGES The from VDSS_CLINIC_MASTER_REC t where t.D IM_DATE=to_date (' | | p_date | | ', "yyyy/MM/dd") and rownum & lt;=2000 group by '| | str1 | |', '| | str2 | |', '| | str3 | |', '| | str4 | |', '| | str5 | |'. ';
The BEGIN The delete from temp_form_data; The open CUR1 for sql_statement; Loop The fetch cur1 into t_date, t_dept t_identity, t_charge, t_operator, t_type, t_time, t_outp, t_emer, t_daytimeoutp, t_daytimeemer, t_night, t_holidayoutp, T_holidayemer, t_export t_regist; Exit the when CUR1 % notfound; Insert into temp_form_data values (t_date t_dept, t_identity, t_charge, t_operator, t_type, t_time, t_outp, t_emer, t_daytimeoutp, t_daytimeemer, t_night, t_holidayoutp, T_holidayemer t_export, t_regist); End loop; The close CUR1; commit; END;
CodePudding user response:
Position error is the cursor the line The open cur1 for sql_statement reported missing expression
CodePudding user response:
You write sql_statement strings behind the begin a try, their print sql_statement see SQL if you have any questions