Hi All,
For the below code i'm not getting any error in SQL developer.
When executing the same SQL plus im facing below error. Why is it so ??
Below is not the actual code and it just a sample which is also throwing the COMMIT error. Please advise
SET DEFINE OFF;
SET SERVEROUTPUT ON;
SET TIMING ON
PROMPT #___________________________________________#
DECLARE
CURSOR C1 IS
select level from dual connect by level < =10;
BEGIN
FOR REC IN C1
LOOP
BEGIN
DBMS_OUTPUT.PUT_LINE(REC.LEVEL);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error: Others ');
END;
END LOOP;
COMMIT;
END;
COMMIT;
PROMPT #___________________________________________#
SET ESCAPE ON;
SET DEFINE ON;
SET SERVEROUTPUT OFF;
SET TIMING OFF;
Error Log:-
05:00:45|INFO> #___________________________________________#
05:00:45|INFO> COMMIT;
05:00:45|INFO> *
05:00:45|INFO> ERROR at line 27:
05:00:45|INFO> ORA-06550: line 27, column 1:
05:00:45|INFO> PLS-00103: Encountered the symbol "COMMIT"
05:00:45|INFO> Elapsed: 00:00:00.01
05:00:45|INFO> #___________________________________________#