Transform Map to update records on sys_user table - unique key violation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 04:05 AM
Hi,
I can see this question has been asked a few times before but I can't find a solution for my issue. I've created a transform map to load the value of a newly created attribute on the sys_user table. When I run the transform map I get a unique key violation error.
Unique Key violation detected by database ((conn=7335) Duplicate entry '8b35677187ec211019bcec6e8bbb35c7' for key 'PRIMARY')
I've set 'Run business rules' to FALSE and set both of my onBefore scripts to inactive which has made no difference. Also confirmed that no business rules on the sys_user table is using current.update().
Anyone had the same issue or able to advise?
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 04:32 AM
Hi @Steven Watts2 ,
Are you inserting a new record in User table ?
If not and you would only want to update records, Then you need to add below code in transform script section.
if(action =="insert"){
ignore = true;
}
if Yes, Then there might be uniqueness of particular field is set on user table and so while transforming a data that unique field throwing error.
Thanks,
Pratik Malviya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 04:42 AM
Thanks for responding. No, the intent is only to update records, no inserts. I have already tried the following onBefore script, currently set to inactive for testing, and unfortunately still get the same issue.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (action == "insert") {
ignore = true;
}
})(source, map, log, target);
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 06:26 AM
Hi @Steven Watts2 ,
I tried this on my PDI but unable to replicate.
Check below, if it works for you.
Please mark correct if it helps you.
Thanks,
Pratik Malviya