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

3

The error is when I run:

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

Exception:

java.sql.SQLSyntaxErrorException: ORA-00900: instrução SQL inválida
    
asked by anonymous 09.07.2014 / 21:18

1 answer

1

You should only use the update command

update teste set num = 1234 where num = 1

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

    
09.07.2014 / 22:22