使用 SQLPLUS 命令行在以下过程中运行时出现 ORA-00905: missing keyword 错误。奇怪的是,当我通过 PL/SQL 开发人员中的 SQL 窗口运行它时,它可以编译并工作,不幸的是,我也需要它通过命令行工作:
CREATE OR REPLACE PROCEDURE PRO_INSERT_ALERT_END_DATE IS
CURSOR cur_InsertEndDate IS
SELECT cli_per_id,
date_ended,
date_started,
alertid
FROM CP_END_ALERT;
BEGIN
FOR rec_cur_InsertEndDate IN cur_InsertEndDate
LOOP
BEGIN
UPDATE vwe_alert_table
SET alert_inactive_on = rec_cur_InsertEndDate.date_ended,
alert_inac_reason = 'Deregistered'
WHERE vwe_alert_table.art_id = rec_cur_InsertEndDate.alertid AND
vwe_alert_table.art_per_id = rec_cur_InsertEndDate.cli_per_id AND
vwe_alert_table.art_alerted_on = rec_cur_InsertEndDate.date_started AND
vwe_alert_table.art_alert = 'AL02';
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error updating record ' || SUBSTR(SQLERRM, 1, 250));
ROLLBACK;
END;
END LOOP;
END PRO_INSERT_ALERT_END_DATE;
任何建议都将受到欢迎