Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 156 157 158 159 160 161 < 162 > 163 164 165 166 167 168 .. 241 >> Next

Parent Index ID (except UNRESOLVED) SMALLINT yes
Parent Key Columns VARCHAR(512) yes

Teradata RDBMS for UNIX SQL Reference

8-179
Teradata SQL Syntax Guide

HELP CONSTRAINT

Unique Constraint

Examples

Example 1

Field Data Type Nullable
Constraint Name VARCHAR(30) no
Constraint Type (PRIMARY INDEX/PRIMARY KEY/UNIQUE/SECONDARY INDEX VARCHAR(15) no
Unique? CHAR(I)
Index Id SMALLINT no
Column Named VARCHAR(512) no

The following example set shows how the HELP CONSTRAINT statement can be used.

This example shows the report returned for a table with a CHECK constraint.

HELP CONSTRAINT table_1.check_1;

Name Type FK Columns

check_1 CHECK CHECK("field_1">0

AND"field 2">0)

The following example shows the report returned for a table with Example 2 REFERENTIAL constraints.

HELP CONSTRAINT table_1.reference_1;

Name Type FK Columns Parent PK

Table Name Columns

reference_ REFERENCE field_1, table_2 field_3,

1 field 2 field 4

The following example shows the report returned for a table with a Example 3 REFERENTIAL constraint on the primary key.

HELP CONSTRAINT table_1.primary_1;

Name Type Columns

primary_1 PRIMARY KEY field_1, field_2

8-180

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

HELP CONSTRAINT

The following example shows the report returned for a table with a

Example 4 UNIQUE constraint.

HELP CONSTRAINT table_1.unique_1;

Name Type Columns

unique_1 UNIQUE field_3, field_4

The following example shows how the system handles a HELP

Example 5 CONSTRAINT request that doesn’t fit the tabled being analyzed.

HELP CONSTRAINT table_1.no_such_check;

The error message, The specified constraint name does not exist in table’, is returned if table table_1 does not have a constraint with the name ‘no_such_check’ exists in table.

Teradata RDBMS for UNIX SQL Reference

8-181
Teradata SQL Syntax Guide

HELP DATABASE HELP USER

HELP DATABASE HELP USER

When HELP DATABASE or HELP USER is entered, the Teradata RDBMS returns a list of all tables, views, and macros in the specified database, sorted by object name. The list includes the following information about each object:

• Name - CHAR (30)

• Type - CHAR (1)

• T indicates table

• V indicates view

• M indicates macro

• Comment, if available. - VARCHAR (255) nullable

• see “COMMENT” statement

• Protection - CHAR (1)

• N indicates none

• F indicates FALLBACK

• Creator name - CHAR (30)

8-182

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

HELP INDEX

HELP INDEX

The HELP INDEX tname statement returns information about all Function the indexes defined for a table.

The following example returns information about the specified Example index.

HELP INDEX tname (cname[,cname...])

The following example returns information about the index named primaryone.

HELP INDEX primaryone

Index information from HELP includes the following:

• Unique? -- CHAR (1)

• N indicates non-unique

• Y indicates unique

• Primary or Secondary -- CHAR (1)

• P indicates primary

• S indicates secondary

• Column names -- VARCHAR (512)

• Index ID (assigned to the index by the system)

• Approximate count -- FLOAT (number of rows in the index subtable)

• Name -- CHAR(30) lists the index name, if there is one. This column is NULL if the index is unnamed.

Teradata RDBMS for UNIX SQL Reference

8-183
Teradata SQL Syntax Guide

HELP SESSION

Function

HELP SESSION

The HELP SESSION statement returns the attributes associated with

the user of the current session, as follows:

• User Name is the name of the owner of the session.

• Account Name is the name of the owner of User Name.

• Logon Date is the date of logon to the Teradata RDBMS, in the format YY/MM/DD.

• Logon Time is the time of logon to the Teradata RDBMS, in the format HH:MM:SS.

• Current DataBase is the database currently defined as the default for the session (see “DATABASE” and “CREATE USER” statements).

• Collation is the sort sequence currently defined for the session (see “SET SESSION COLLATION” and “CREATE USER” statements), e.g., ASCII.

• Character Set is the character set currently defined for the session, e.g., ASCII

• Transaction Semantics indicates whether the session is in ANSI (A) or Teradata (T) mode. Not nullable.

8-184

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

HELP STATISTICS

HELP STATISTICS

The HELP STATISTICS tname statement returns information about statistics that have been collected for the specified table. If a COLLECT STATISTICS statement has not been submitted for the table, a message is returned.

HELP STATISTICS information may be useful in determining whether statistics for the table should be updated or dropped (see COLLECT/DROP STATISTICS). The return includes:

• Date of collection - CHAR (8)

• Time of collection - CHAR (8)
Previous << 1 .. 156 157 158 159 160 161 < 162 > 163 164 165 166 167 168 .. 241 >> Next