BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EinarRoed
Pyrite | Level 9

I've created a job that's using a composite PK which includes eight variables. When I run the job, the final Table Loader generates an error message telling me  "Duplicate values not allowed on index pk_index for file MYTABLENAME." The Constraint- and Index Conditions of the Table Loader are both set to "After Load: On (table creation)". What is a good way to resolve this situation? I've never handled something like this before.

Thanks for your time.

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Obviously, you have duplicate values in your source data.

How to handle this is a matter of process.

Perhaps you have the source data i some kind of staging table, which will make it easy to examine and determine the duplicates.

If duplicates are common, you could add some logic in your flows to find the duplicates prior to the loading step, hand have them stored in a separate table. The Data validation transformation could be used for this.

About the constraints, what is the requirement to handle data quality? Having constraints on a target like this is like a guarantee that the data is consistent. You pay with a little overhead during load. The trade off is when to restore or in other ways clean up the target table after a load of duplicate values.

Data never sleeps

View solution in original post

1 REPLY 1
LinusH
Tourmaline | Level 20

Obviously, you have duplicate values in your source data.

How to handle this is a matter of process.

Perhaps you have the source data i some kind of staging table, which will make it easy to examine and determine the duplicates.

If duplicates are common, you could add some logic in your flows to find the duplicates prior to the loading step, hand have them stored in a separate table. The Data validation transformation could be used for this.

About the constraints, what is the requirement to handle data quality? Having constraints on a target like this is like a guarantee that the data is consistent. You pay with a little overhead during load. The trade off is when to restore or in other ways clean up the target table after a load of duplicate values.

Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 2664 views
  • 0 likes
  • 2 in conversation