leathamadan
leathamadan

Reputation: 29

ORA-00905: missing keyword in SQL PLus

I am getting an ORA-00905: missing keyword error when running in the following procedure using the SQLPLUS command line. Strangely it compiles and works when I run it in via an SQL window in PL/SQL developer, unfortunately I need it to work via the command line as well:

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;

Any advice would be most welcome

Upvotes: 0

Views: 1735

Answers (1)

kirotnes
kirotnes

Reputation: 259

It is probably due to the blank lines in the script. Tell SqlPlus to ignore them

 set sqlblanklines on

Upvotes: 1

Related Questions