17.10 - Example: Changing the Row-Level Security Level for a Session - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

User pls logs on. The resulting session has a label consisting of an unclassified level and a nato category. As soon as the session is established, pls changes the level to secret.

     SET SESSION CONSTRAINT = classification_level (secret);

After the SET SESSION CONSTRAINT request executes, the session has a label of secret and nato.

Suppose that the session initiated by pls is used to insert 3 rows into the table named inventory. The INSERT requests used to insert the rows into inventory are as follows.

     INSERT INTO inventory VALUES (1212, 90505,'Widgets',,);
     INSERT INTO inventory VALUES (12122, 90504,'Buggy Whips',,);
     INSERT INTO inventory VALUES (12126, 90501,'Whip Sockets',,);

The last two positional values are generated by the INSERT constraint UDFs, not by the session.

The column values for the rows after these INSERT requests complete are as follows.

inventory        
col_1 col_2 col_3 classification_level classification_category
1212 90505 Widgets 3 ‘0100000000000000'XB
12122 90504 Buggy Whips 3 ‘0100000000000000'XB
12126 90501 Whip Sockets 3 ‘0100000000000000'XB