cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion happened but records were not deleted

Former Member
0 Kudos
54

Hi

I have run an xs job for deleting records of a huge table. It ran successfully for one table, but the other table which is huge it ran for an hour and finally when i checked the record count din't move.
What has happened or what can be the reason for this ?

Accepted Solutions (0)

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos

Code please

Former Member
0 Kudos

var sql = "DELETE FROM \"" +

    input.schema +

    "\".\"" +

    input.table1 +

    "\" WHERE \"" +

    input.col1 +

    "\"" +

    " NOT IN " +

    "(SELECT \"" +

    input.col2 +

    "\" FROM " +

    "\"" +

    input.schema +

    "\".\"" +

    input.table2 +

    "\")";

   

    var conn = $.db.getConnection();

    var pstmt = conn.prepareStatement(sql);

    //pstmt.executeUpdate();

    var rows = pstmt.executeUpdate();

    conn.commit();

    conn.close();

vijay_kumar49
Active Contributor
0 Kudos

did you test the sql statement and connection? is it working