I've DI job which loads data to the physical table via SCD type-2 transformation. When I ran the job I received an error like
"WARNING: Add/Update failed for data set INS.EMPLOYEE because data value(s) do not comply with integrity constraint PRIM_KEY. (Occurred 38 times.) NOTE: There were 38 observations read from the data set WORK.ETLS_MATCH.
NOTE: 0 observations added."
Business key for my job is "Employee_ID" and there is no duplicates on Employee_ID and generated key is "Employee_RK". Could someone you help me understand the likely cause for this issue?
Doesn’t this mean the records you’re trying to insert, the 38 employee IDs, are already in the table?
@Babloo wrote:
I've DI job which loads data to the physical table via SCD type-2 transformation. When I ran the job I received an error like
"WARNING: Add/Update failed for data set INS.EMPLOYEE because data value(s) do not comply with integrity constraint PRIM_KEY. (Occurred 38 times.) NOTE: There were 38 observations read from the data set WORK.ETLS_MATCH.
NOTE: 0 observations added."
Business key for my job is "Employee_ID" and there is no duplicates on Employee_ID and generated key is "Employee_RK". Could someone you help me understand the likely cause for this issue?
The primary key on your target table is {Employee_RK, <Valid_From_Dttm>}? Right?
And the Valid_From_Dttm column (or however you call it) contains a SAS Datetime value?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.