assign primary key value from seq
I would like to have a primary key as a sequence and have ClientHCPLocationID as unique key. I don’t want to have ClientHCPID as the primary key because the records we would get would be something like bellow:
File Structure A
ClientHCPID| ClientHCPLocationID
A1B2|123
A1B2|345
A1A1|222
A1A1|432
The same table is used to insert another file with records which may not have ClientHCPLocationID and just ClientHCPID. So actually I cannot think of having ClientHCPLocationID as primary/Unique key
Something like:
File Structure B
A1B2|address1
A1B3|address1
So if I have surrogate key(sequence) as the primary key, how can adeptia determine if the file records are updates or inserts. I want it to check for ClientHCPLocationID and ClientHCPID to determine the insert/update. Please note in this PF we are using the File structure A but the table is common for A and B.
-
For achieving your scenario you need to create two different DB schema activities in Adeptia use below scenario while schema creation:
For File Structure1 schema: Use "ClientHCPLocationID" as Primary Key
For File Structure2 schema: Use any other Unique field as Primary key on the basis of which Update/Insert will be performed.There will be a Primary key on Database level that can be different from above set Primary keys in schema.
0
Please sign in to leave a comment.
Comments
1 comment