We have following query to get the records deleted on fk_data_table
, and been found we weren’t able to, as because of 400k records.
Delete FROM BOM_LINK WHERE TEST_OBJECT_OID IN (SELECT DISTINCT TESTOBJECT_OID FROM TESTOBJECT WHERE TESTOBJECT.TESTOBJECTTYPE_OID = 3);
DB2 Error Code -495 https://www.sqlerror.de/db2_sql_error_-495_sqlstate_57051.html
I think what we can do is,
- We can write a function or procedure
- We can retrieve data by writing query by SELECT and CURSOR options, instead directly deleting
- While iterating CURSOR we can try deleting it. (I am not sure that in this way we can delete the row, anyway lets find this out)
- We can do periodical commit, instead of doing commit after extensive amount of deletion.
Could someone help us sorting out this issue which we are facing. Pointing to some SQL code snippets will help us a lot.