Search code examples
sqloracle-databasesyntax-errororacle-apex

ORA-00933: SQL command not properly ended EVEN tho I am actually using the standard syntax


I am working on a project for my SQL class and after making a query with subqueries in it i received this error:

ORA-00933: SQL command not properly ended

Automatically I started looking for answers everywhere and after a lot of searching, I thought it would be easier to remake the query step by step, and after butchering it I remained with the error and now it looks like this:

Error at line 3/16: ORA-00933: SQL command not properly ended

Query:

UPDATE requests
SET price = 3
WHERE price= 10;

ROLLBACK; 

I simplified it as much as I could but it looks like it stuck with me even if the query is as simple as that.

Any ideas?


Solution

  • You found one way to make it work - use PL/SQL block.

    Error you got is due to Apex running everything it finds at once (it isn't related to rollback, could've been any other statement - select, update, delete, create table, ... whatever).

    enter image description here

    However, if you first select a single statement and then click the "Run" button, it'll work:

    enter image description here


    Yet another way to execute statements is to create a script and run that script:

    enter image description here