Probably missing something trivial here but I have a function in my Java application running on Oracle 10g which generates a bunch of insert and delete statements into a BEGIN...; END; block.
When I execute the statement, it runs without error yet the values are not inserted/deleted to the database. If I copy the SQL that is to be run into SQL developer and execute it, it works as expected.
Example SQL...
BEGIN
INSERT INTO tablea_archive (col1,col2,col3)
SELECT col1,col2,col3 FROM tablea;
DELETE FROM tablea;
INSERT INTO tableb_archive (col1,col2,col3)
SELECT col1,col2,col3 FROM tableb;
DELETE FROM tableb;
END;
I have tried running the code via prepared,callabale and normal Statements with execute() and executeUpdate() and no joy.
Can anyone point out what I'm doing wrong?
commit;maybe. In SQL Develeoper is AutoCommit on maybe.