mysql 存储过程 forall_PL/SQL 存储过程出错

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高手帮忙分析分析原因

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值