ORA-00933: SQL command not properly ended (in simple insert statement)
The following simple statement:
INSERT INTO mydb.inventory (itemID) VALUES (:itemID) WHERE playerID = :ID;
Generates the following error:
ORA-00933: SQL command not properly ended
I have tried it without the semi-colon as well as with, but both give me the error. I am certain that the variables are being bound as well.
All my Google searches show that this is usually caused by an ORDER BY clause, but clearly I don't have one. =P
You only define a WHERE clause if you are populating the INSERT statement with a SELECT. IE:
INSERT INTO mydb.inventory (itemID) SELECT :itemID FROM DUAL
Otherwise, you specify the values as-is:
INSERT INTO mydb.inventory (itemID) VALUES (:itemID)
You specify a WHERE clause when you are updating an existing record:
UPDATE mydb.inventory SET itemid = :itemid WHERE playerid = :ID
An insert can not have a where clause. Perhaps you actually meant to update?
A where clause is rather unusual in an insert statement. Perhaps you're trying to update instead?
UPDATE mydb.inventory SET itemID = :itemID WHERE playerID = :ID;