I’m trying to update the data from my oracle database using this code.
The program has no error but it display ORA-00933: SQL command not properly ended.
Can anyone let me know what does it mean and how can I correct it?
String gdta="
UPDATE CLIENT_DATA SET CLIENT_ADDRESS4 = 'SELANGOR'
WHERE CLIENT_ADDRESS4 = 68100 BATU CAVES SELANGOR D.E.
UNION
UPDATE CLIENT_DATA SET CLIENT_ADDRESS4 = 'SELANGOR'
WHERE CLIENT_ADDRESS4 = 47100 PUCHONG,SELANGORUNION
UPDATE CLIENT_DATA SET CLIENT_ADDRESS4 = 'SELANGOR'
WHERE CLIENT_ADDRESS4 = 47100 PUCHONG";
You can’t combine update statements in a union statement. Also it looks like you need to quote the client_address4 values.
Try running your SQL command in a SQL client before trying it in java and see if it works.
I think you need to execute multiple statements, instead of a single one, like this:
or, use a single statement with an in-clause: