I have a problem with an Oracle Connector. It should work as follows:
1 - Delete rows where the start date is equal to SYSDATE
2 - Insert data in that table
3 - Update rows with start date different from SYSDATE
I wrote the delete statement in "Before SQL statement" and it works. Step 2 works as well. The update statement in step 3 is written in "After SQL statement", but although the log says the command has been executed it has no effect on the table.
The UPDATE is as follows:
UPDATE table
SET end_date = TO_DATE(TO_CHAR(SYSDATE, 'YYYYMMDD'), 'YYYYMMDD') - 1,FLAG = 'N'
I tried to put the UPDATE and DELETE statements together,inside a BEGIN/END block, but then the job failed because it doesn't recognize the COMMIT statement after the block.
I tried to write the UPDATE statement just after the DELETE statement and before the COMMIT and it still has no effect on the table, while, again, the DELETE statement keeps working.
I also tried to execute both statements directly on the DB with SQL Developer and it worked. The only thing I know is that it's not a syntax problem.
Can someone help me?
I tried to put the
UPDATE
andDELETE
statements together, inside aBEGIN
/END
block, but then the job failed because it doesn't recognize theCOMMIT
statement after the block.
Put the COMMIT
statement inside the PL/SQL block.