3
The error is when I execute:
execute immediate 'update teste set num = 1234 where num = 1';
Exception:
java.sql.SQLSyntaxErrorException: ORA-00900: instrução SQL inválida
3
The error is when I execute:
execute immediate 'update teste set num = 1234 where num = 1';
Exception:
java.sql.SQLSyntaxErrorException: ORA-00900: instrução SQL inválida
1
You should only use the update command
update teste set num = 1234 where num = 1
EXECUTE IMMEDIATE is only for executing SQL sentences within function blocks or PL/SQL triggers (see documentation)
Browser other questions tagged java database oracle
You are not signed in. Login or sign up in order to post.
Hello @lucasRomero, welcome to [en.so]. In what context are you trying to perform this command? If it is via application, would not an update be enough? If my memory doesn’t fail me,
execute immediate
is to be used within triggers and functions– Caputo
That line I posted is just for testing, the ones that will be run I don’t have access.
– Lucas Romero
Renan, the part of the command
update teste set num = 1234 where num = 1
is beautiful, I have tested select, Insert, update and delete. I did not run tests withexecute immediate
.– Lucas Romero
I removed my previous comment because it was really wrong according to the manual. The column
num
is really numerical?– Oralista de Sistemas
It’s numerical. If I just run
update teste set num = 1234 where num = 1
it works, the problem is when I addexcute immediate
.– Lucas Romero