I have a process that does a bulk import where I build a field value given incoming values. Sometimes, ALL of the incoming values are the same, but they are not duplicates. Since this is a bulk import, I don't know of any way to really check if the field value I have built is being built the same for another record within that import. So, I am wondering about the possibility to have some kind of constraint or trigger on the insert? For instance, I have the records:
[pre]
AcmeTools 20000 1/15/2018 Credit 12345678
AcmeTools 20000 1/15/2018 Credit 12345678
[/pre]
When I build the field I would typically use something like 12345678Acmetools01152018$200000
However, I need the fields to be unique and this will not create a unique value. So, I would like to add an incremental value on to the end of the created value if it would be a duplicate, so 12345678Acmetools01152018$2000001, 12345678Acmetools01152018$2000002, etc. Is there a way to do this with a constraint or does this need to be a trigger? And I am trying to find an efficient method as this could be part of a daily import of up to 20000 records 7 days/week.
Thanks in advance for any help!
Willie
[pre]
AcmeTools 20000 1/15/2018 Credit 12345678
AcmeTools 20000 1/15/2018 Credit 12345678
[/pre]
When I build the field I would typically use something like 12345678Acmetools01152018$200000
However, I need the fields to be unique and this will not create a unique value. So, I would like to add an incremental value on to the end of the created value if it would be a duplicate, so 12345678Acmetools01152018$2000001, 12345678Acmetools01152018$2000002, etc. Is there a way to do this with a constraint or does this need to be a trigger? And I am trying to find an efficient method as this could be part of a daily import of up to 20000 records 7 days/week.
Thanks in advance for any help!
Willie