Monday, November 19, 2012

Number of affected records is not equal to number of records inserted

I have come across a situation where number affected records in session run properties is not matching with the number of records actually inserted into the table. Target database is Teradata and connection is ODBC. 

Details of the problem:

Number of affected records is not equal to number of records inserted into the table. 
what happened to remaining records? Is some roll back happened? 

Below are the screen shots of the issue:

Session Run Properties and Number of records in database:

Session Run Properties

Number of records in target table

















Reason: 
By default session mode of ODBC connection is 'Teradata'. When the session mode is Teradata then Teradata rolls back the transaction when it encounters an error. In the above situation, we had error records so Teradata rolled back the transaction hence the number of records in session properties is not equal to number of records inserted into table. 

Solution: 
Change the session mode to 'ANSI' by adding SessionMode=ANSI in DSN of the ODBC connection in odbc.ini file.

Note: changing the session mode to ANSI may fail other sessions if any session is using stored procedures complied in session mode=Teradata. 

3 comments:

  1. Informatica Online Training very less prices only at

    http://www.dwbiadda.com/course/informatica-online-training/

    --
    Thanks and Regards
    Your Best Online Training Partner
    Team DWBIADDA.com,
    www.dwbiadda.com
    http://dwbiadda.blogspot.in/
    Call +91-720-720-9005
    Mail:dwbiadda@gmail.com
    Skype: DWBIADDA

    ReplyDelete
  2. mob number plz for idq training.else called me at 9538997219.

    ReplyDelete