Oracle7 Server Application Developer's Guide

Contents Index Home Previous Next

Trusted Oracle ROWLABEL Column

The ROWLABEL column is automatically appended to each Trusted Oracle table at table creation. This column contains a label of the MLSLABEL datatype for every row in the table.

In OS MAC mode, given that a table can contain rows at one label only, the values in this column are always uniform within a table (and within a single database).

In DBMS MAC mode, the values in this column can range within a single table from DBHIGH to DBLOW (within any constraints defined for that table).

Retrieving Row Labels

The ROWLABEL column is not automatically returned as part of a query. To retrieve the label of a row, you must explicitly select the ROWLABEL column.

For example, to retrieve the label of a row from a table or view, specify the ROWLABEL column in the SELECT statement:

SELECT rowlabel, ename FROM emp
   WHERE ename = 'JASUJA'

which returns

ROWLABEL                           ENAME
--------------------------------   ----------
SENSITIVE                          JASUJA

You can also specify the ROWLABEL pseudo-column in the WHERE clause of a SELECT statement:

SELECT rowlabel,ename FROM emp
    WHERE rowlabel = 'SENSITIVE'

which returns

ROWLABEL                           ENAME
--------------------------------   ----------
SENSITIVE                          JASUJA
SENSITIVE                          ASHER

Retrieving All Labels From a Table

Note that when you select all columns from a table (SELECT *), the ROWLABEL column is not returned. You must explicitly specify that you want to retrieve the label in order to retrieve it. For example, to retrieve all columns, including the ROWLABEL column, from the DEPT table, enter the following:

SELECT rowlabel, dept.*
    FROM dept

This provides for compatibility with older applications (for example, Oracle RDBMS Version 6) or those designed to run in single-level and multi-level environments. However, the values for ROWLABEL are always utilized for MAC enforcement, and are always available in Trusted Oracle for retrieval and display when specified.

Retrieving Labels from Multiple Tables

To retrieve the label from more than one table or view, you must preface the ROWLABEL column with the table or view name. For example, to retrieve the ROWLABEL column from the EMP and DEPT tables wherever there is a match in department number, enter:

SELECT emp.rowlabel, dept.rowlabel
   FROM emp, dept
   WHERE emp.deptno = dept.deptno

If specifying the names of multiple tables becomes too lengthy, you can create synonyms for the table names within the query itself.

For example, the following query is identical to the query above:

SELECT e.rowlabel, d.rowlabel
    FROM emp e, dept d
    WHERE e.deptno = d.deptno

Modifying Row Labels

You can specify any valid operating system label in the ROWLABEL column, as described in"Adding New Labels" [*].

In OS MAC mode, you can perform inserts and updates to the ROWLABEL column under certain restrictions. In DBMS MAC mode, you can modify the ROWLABEL column if you have the appropriate MAC privileges

For detailed information on modifying the ROWLABEL column, see your Trusted Oracle7 Server Administrator's Guide.


Contents Index Home Previous Next