Join this group to access featured content and participate in discussions related to DMX.

140 Members
Join Us!

Replies

  • For all database systems (DB2, Oracle, Teradata, etc.), it is possible to control whether or not the task terminates if a record insert fails.  The Target Database Table dialog has the checkbox "Abort task if any record is rejected"; if you check this, then any insert failure (for a duplicate primary key or ANY other reason) will cause the task to abort.  If you do not check this, then the task will continue.

  • Every record in every Database has one or more unique key-fields and other fields.

    A unique key does exist only once and a not acceptable duplicate for a Database is the existence of the same key once more.

    Most databases do not accept that their key is changed via an update only the other fields.

    So basically there isn't any possibility for a duplicate during an update.

     

    • Correct, but what happens if DMX task is configured for "add new row" option ? I have a requirement where I get data from a different system. It is possible that 2 records can have the same data.. Since I am using this data as the key, what I would like to do is to first try update the database with the data received from the external system. If DB2 returns a duplicate key error , then I would like to bump the value by 1 and try to update the DB2 again with the new data. I need to repeat this till I add DB2 with a unique key.

      I kind of need to try add the new row in a loop till I hit a unique key that gets added to the database.

      • I am just trying to understand this explanation in DMX documentation . When duplicate key error happens, does the DMX task abort ?

        Insert rows

        DMExpress does not alter any rows already in the table when you run your task but inserts new rows. When you choose this option, ensure that rows added to the table do not cause duplicate key errors

        • If you think something can go wrong, than you have a thousand ways to prevent this before happening. Do not challenge tools nor Databases. You can do a huge amount of checks before you load to a DB and check for duplicates outside before you try out how your DB does react.

           

This reply was deleted.

To access Syncsort Knowledge Base, visit:

My Support