我有一個方法像下面,但是當我試圖使用運行它的sqlplus它給了我錯誤錯誤無效號碼ORA-01722的過程
BEGIN IB_ARCHIVE_FDS(「FDS_LOG」,「TIME_REQUEST」, 5,6);結束; ORA-01722::無效號碼ORA-06512:
位於第1行錯誤在 「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;
有人可以幫我解決我的問題。
什麼'sysdate - '|| SUCCESS_PERIOD || ' - 1'呢? – 2013-04-22 08:18:31
@ Colin'tHart - 它拋出一個ORA-01722,主要是... – 2013-04-22 08:26:50
這就是我的想法,但星期一上午我不太確定。 – 2013-04-22 08:31:37