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

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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