Search code examples
sap-commerce-cloudimpex

Unique values for combination of columns in Hybris Impex Files


I'm creating a Hybris impex file to import into my Database.

I want to perform an INSERT_UPDATE action with the data from the file, so I need to tell Hybris which column(s) need to be unique, so that it knows when to update a record instead of insert it.

I know that to tell Hybris that a certain column needs to be unique I can add the unique attribute to that column, like this:

INSERT_UPDATE SLEmployee;Firstname[unique=true, required=true];Lastname[required=true];Function;

But on my example above, how do I tell Hybris that the combination of the columns Firstname + Lastname must be unique?


Solution

  • > how do I tell Hybris that the combination of the 
    > columns Firstname + Lastname must be unique?
    

    Add the unique keyword to every field that is part of the combined key

     INSERT_UPDATE SLEmployee;Firstname[unique=true];Lastname[unique=true];Function;