createorreplaceprocedurep_index_checkisv_sqlvarchar2(2048);v_bttimestamp;v_fttimestamp;cursorc1isselect*fromindex_check_log;Beginforr1inc1loopv_sql:=r1.sql_statement;upda...
create or replace procedure p_index_check is
v_sql varchar2(2048);
v_bt timestamp;
v_ft timestamp;
cursor c1 is select * from index_check_log;
Begin
for r1 in c1 loop
v_sql := r1.sql_statement;
update index_check_log aa
set aa.v_begin_time = (to_char(systimestamp, 'yyyy-mm-dd hh24:mi:ssxff'))
where aa.id_log = r1.id_log;
v_bt := systimestamp;
execute immediate v_sql;
v_ft := systimestamp;
update index_check_log bb
set bb.v_finish_time = (to_char(systimestamp, 'yyyy-mm-dd hh24:mi:ssxff'))
where bb.id_log = r1.id_log;
update index_check_log cc
set cc.diff_time = (v_ft - v_bt)
where cc.id_log = r1.id_log;
End loop;
End;
PL/SQL 7.15
服务器端oracle 9i
出错代码:
Compilation errors for PROCEDURE CCSP.P_INDEX_CHECK
Error: PL/SQL: ORA-06553: PLS-103: Encountered the symbol ")" when expecting one of the following:( - + case mod new null avg count current max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe
The symbol "null" was substituted for ")" to continue.
Line: 7
Text: cursor c1 is select * from index_check_log;
Error: PL/SQL: SQL Statement ignored
Line: 7
Text: cursor c1 is select * from index_check_log;
Error: PLS-00364: loop index variable 'R1' use is invalid
Line: 11
Text: for r1 in c1 loop
Error: PL/SQL: Statement ignored
Line: 11
Text: for r1 in c1 loop
Line: 21
Text: where bb.id_log = r1.id_log;
Error: PL/SQL: SQL Statement ignored
Line: 21
Text: where bb.id_log = r1.id_log;
请Orale高手帮忙分析分析原因
展开