Wednesday, 1 August 2012

ORA-02185: a token other than WORK follows COMMIT

Problem Generate:-
abc.txt
update table xxx set sal=sal+100 where empid=1;
update table xxx set sal=sal+100 where empid=2;
update table xxx set sal=sal+100 where empid=3;
commit;
update table xxx set sal=sal+100 where empid=4;
update table xxx set sal=sal+100 where empid=5;
update table xxx set sal=sal+100 where empid=6;
commit
update table xxx set sal=sal+100 where empid=7;
update table xxx set sal=sal+100 where empid=8;
commit;

spool '/u01/log.log' 
@ abc.txt
spool off

check log.log file & see the error


1 row updated

update table xxx set sal=sal+100 where empid=7;
*
ERROR at line 2:
ORA-02185: a token other than WORK follows COMMIT



Solution:- 
check your code and see if you add (:) colon instead of ( ; ) semicolon after the COMMIT in your code.




2 comments:

Unknown said...

Thanks Mate.....

Broken Window said...

Oh thanks, that is what happened to me in Orace 11g with SqlDeveloper.