ORA-00905:SQL PLus中缺少关键字

时间:2013-04-02 15:16:31

标签: plsql sqlplus

使用SQLPLUS命令行在以下过程中运行时,我收到ORA-00905:缺少关键字错误。奇怪的是,当我通过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;

欢迎任何建议

1 个答案:

答案 0 :(得分:1)

可能是由于脚本中的空行。告诉SqlPlus忽略它们

 set sqlblanklines on