Applying row-level protection
Protect row-level data by associating the table with a security policy and inserting an IDSSECURITYLABEL-type column.
There are two methods for applying row-level protection:
- For a new table: Use the CREATE TABLE statement with the appropriate IDSSECURITYLABEL and SECURITY POLICY clauses, as described in HCL Informix® Guide to SQL: Syntax.
- For an existing table: Use the ALTER TABLE statement with the appropriate IDSSECURITYLABEL and ADD SECURITY POLICY clauses, as described in HCL Informix Guide to SQL: Syntax.
The following example shows a statement that applies row-level
protection when you create a new table (T1) by using
the security policy named company and the security
label named label2.
CREATE TABLE T1
(C1 IDSSECURITYLABEL,
C2 int,
C3 char (10))
SECURITY POLICY company;
The following statement provides an example of applying row-level protection on a table (T2) that already exists on the database, by using the security policy named company. The default value for C1 is label3.
ALTER TABLE T2
ADD (C1 IDSSECURITYLABEL DEFAULT 'label3'),
ADD SECURITY POLICY company;