What are the requirements for key columns (PK, FK) in OneIM?
説明
What are the requirements for key columns (PK, FK) in OneIM?
対策
Key columns (PK, FK) in OneIM need to be a UID. From db prospective it would indeed be not necessary, as long as the value is unique. But for the object layer key columns have to follow a certain syntax. That can be a UUID ("2E7AAAC8-7A4D-4BD0-919E-EB60B9743754"), a module GUID (CCC-2E7AAAC87A4D4BD0919EEB60B9743754) or a unique identification ("MOD-T-DialogTable").
In OneIM a value for a key column is always a modification of a UUID or an identification. The column type is ALWAYS varchar(38).
SchemaExtension creates this PK column automatically for tables.
For a view the appropriate select statement has to be provided. If you don't find a native varchar(38) column, which uniquely identifies an object in a view, you can cast another unique column to varchar(38) or you can use the SQL scalar function, for example dbo.QBM_FCVStringToGUID(null, CCC_HR_EmployeeID) as CCC_HR_EmployeeID_PK or dbo.QBM_FCVStringToGUID(null, CCC_HR_GivenName+CCC_HR_EmployeeID) as combi PK.