SECLABEL_BY_COMP Function
The SECLABEL_BY_COMP function returns an IDSSECURITYLABEL object, which is a security label in its internal encoded string format. This function enables users to provide a security label directly by specifying its component values.
If a security label component requires multiple values, then such multiple values can be specified by putting those values between parenthesis as in (value_1, value_2, ...). When a component in a particular security label needs to be empty, it can be specified by putting nothing between an opening and a closing parenthesis, as in (). Because the blank space (ASCII 32) is a valid character in an element value for a security component, any blank space appearing in the security label string is treated as part of the element value for that component.
The security label string is limited to a maximum of 32 kilobytes. An error is returned if the string length exceeds this limit.
INSERT INTO T1
VALUES (SECLABEL_BY_COMP ('MegaCorp', 'VP:Marketing:West'), 1, 'xyz';
INSERT INTO T1
VALUES (SECLABEL_BY_COMP ('MegaCorp', 'Director:(HR,Finance):East'), 1, 'xyz');
INSERT INTO T1
VALUES (SECLABEL_BY_COMP ('MegaCorp', 'CEO:():EntireRegion'), 3, 'abc');
As in all of these examples, the success of the SECLABEL_BY_COMP function call does not guarantee the success of the INSERT statement, because the security credentials of the user are first compared to the security label that protects table T1, using the IDSLBACRWRITE rules of the MegaCorp security policy, before the database server allows or denies write access for inserting the new row.