15.10 - Constraint - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K
constraint_name
The name of the constraint for which the most recent SQL create text is to be reported.

Example: SHOW CONSTRAINT

This example shows a valid case of SHOW CONSTRAINT for a row-level security constraint.

The constraint is defined using the following row-level security constraint UDF.

     CREATE FUNCTION SYSLIB.add_func (
     CURRENT_SESSION SMALLINT)
     RETURNS SMALLINT
     LANGUAGE C
     NO SQL
     PARAMETER STYLE TD_GENERAL
     EXTERNAL NAME 'CS!add_func!/home/xiaoy/test/showtab/constraint/
                    add_func.c';

The constraint is defined as follows.

     CREATE CONSTRAINT c1 SMALLINT, NOT NULL,
     VALUES (a:1),
     INSERT SYSLIB.add_func;

A SHOW CONSTRAINT request made for row-level security constraint c1 returns the DDL for its definition as follows.

     SHOW CONSTRAINT c1;
           *** Text of DDL statement returned.
           *** Total elapsed time was 1 second.
          -------------------------------------------------------------
          CREATE CONSTRAINT c1 SMALLINT, NOT NULL,
          VALUES (a:1),
          INSERT SYSLIB.add_func;