How to give an EXECUTE IMMEDIATE command in an ORACLE database from a JAVA application?


The error is when I run:

execute immediate 'update teste set num = 1234 where num = 1';


java.sql.SQLSyntaxErrorException: ORA-00900: instrução SQL inválida


You should only use the update command.

update teste set num = 1234 where num = 1

EXECUTE IMMEDIATE is only for executing SQL sentences inside PL/SQL function blocks or triggers (see documentation)

Scroll to Top