I have finally traced a dreaded ORA-00933: SQL command not properly ended.
error to not putting a slash between statements.
If I attempt to run this:
SELECT 200 AS integer_result FROM DUAL;
SELECT 200 AS integer_result FROM DUAL;
everything is fine. If I try this:
SELECT 200/7 AS integer_result FROM DUAL;
SELECT 200/7 AS integer_result FROM DUAL;
I get
ORA-00933: SQL command not properly ended.
I can fix it by including a slash:
SELECT 200/7 AS integer_result FROM DUAL;
/
SELECT 200/7 AS integer_result FROM DUAL;
Obviously division has confused Oracle, the poor thing. I have never seen this in any other DBMS, but we live to learn.
What is the rule for adding slashes between statements and why?
The question at What is the difference between terminating an Oracle sql statement with semicolon or with a slash on the next line? has some information, but the accepted answer basically says there’s no difference, which is clearly not right in this case.