我有一个如下所示的过程,但是当我尝试使用 sqlplus 运行它时,它给了我错误
开始 IB_ARCHIVE_FDS('FDS_LOG', 'TIME_REQUEST', 5, 6); 结尾;
第 1 行出现错误:ORA-01722:无效编号 ORA-06512:在“NIAGA.IB_ARCHIVE_FDS”,第 10 行 ORA-06512:在第 1 行
我正在使用 Oracle 9i
CREATE OR replace PROCEDURE Ib_archive_fds(table_name VARCHAR2,
column_name VARCHAR2,
success_period NUMBER,
active_period NUMBER)
IS
TYPE fds_tabs
IS TABLE OF ib_fds_log%ROWTYPE INDEX BY PLS_INTEGER;
TYPE fds_message_id
IS TABLE OF ib_fds_log.message_id%TYPE INDEX BY PLS_INTEGER;
v_fds_log FDS_TABS;
v_message_id FDS_MESSAGE_ID;
BEGIN
SELECT *
bulk collect INTO v_fds_log
FROM ib_fds_log2
WHERE direction = 0
AND status_fds_message = 0
AND time_request < Trunc(SYSDATE - ' || SUCCESS_PERIOD || ' - 1);
FOR i IN 1 .. v_fds_log.last LOOP
V_message_id(i) := V_fds_log(i).message_id;
END LOOP;
forall indx IN 1 .. v_fds_log.count
INSERT INTO ib_fds_log3
VALUES V_fds_log(indx);
COMMIT;
forall indx IN 1 .. v_fds_log.count
DELETE FROM ib_fds_log2
WHERE message_id = V_message_id(indx);
COMMIT;
END;
有人可以帮我解决我的问题吗?