我有一个不能编译的pl / sql示例。我有4个错误,无法弄清楚它在哪里。我试图隔离过程,但我找不到丢失的部分
CREATE OR REPLACE PACKAGE TestLocks AS
PROCEDURE testBlocks(in_iteration IN number, in_loop_no IN number, z OUT number) ;
END TestLocks;
/
CREATE OR REPLACE PACKAGE TestLocks IS
PROCEDURE testBlocks(in_iteration IN NUMBER, in_loop_no IN NUMBER, z OUT NUMBER) IS
BEGIN
startdate:=sysdate;
update test_locks
set last_datetime=startdate
where loop_no =in_loop_no;
-- do loop
FOR i IN in_iteration LOOP
update test_locks
set last_datetime=startdate
where loop_no =in_iteraction;
END LOOP;
END;
END TestLocks;
/
答案 0 :(得分:1)
CREATE OR REPLACE PACKAGE TestLocks AS
PROCEDURE testBlocks(in_iteration IN number, in_loop_no IN number, z OUT number) ;
END TestLocks;
CREATE OR REPLACE PACKAGE BODY TestLocks IS
PROCEDURE testBlocks(in_iteration IN NUMBER, in_loop_no IN NUMBER, z OUT NUMBER) IS
startdate date;
BEGIN
startdate:=sysdate;
update test_locks
set last_datetime=startdate
where loop_no =in_loop_no;
-- do loop
FOR i IN 1..in_iteration LOOP
update test_locks
set last_datetime=startdate
where loop_no =in_iteraction;
END LOOP;
END;
END TestLocks;