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

Teradata RDBMS forUNIX SQL Reference - NCR

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

Teradata SQL Syntax Guide





The HELP statement retrieves information from the Teradata RDBMS Data Dictionary, and includes information about:

• The specified database, table, view, macro, or index;

• All or the specified columns of a table or view;

• Any statistics collected for the specified table;

• The attributes of the current session.

HELP is flagged as non-ANSI when the SQL flagger is enabled. Refer also to HELP (On-line), in the following section.


Teradata RDBMS for UNIX SQL Reference

Teradata SQL Syntax Guide


Usage Notes



Syntax Element ... Specifies . . .
dbname the name of the database for which help is needed.
username the name of the user space for which help is needed.
tname the name of the table for which help is needed.
viewname the name of the view for which help is needed.
macroname the name of the macro for which help is needed.
col_name the name of the column for which help is needed.
from an introduction to the name(s) of one or more tables containing the columns for which help is needed.
* that help is needed for all columns in a table.
name the name of the index, if it has been assigned a name.

Except for HELP USER DBC, the user requesting HELP information must either own the specified object or have at least one privilege on that object (HELP USER DBC does not require any rights on user DBC).

There is no check of object type; HELP USER and HELP DATABASE have the same effect.

The HELP statement allows users to review the attributes of an object or a session without having to construct and execute a query on a Data Dictionary view.

The actual output of HELP results are too wide to be shown on a single screen and are sometimes wider than 132 characters. Interactive users can format returns from HELP with BTEQ formatting commands such as [.]SET SIDETITLES and [.]SET FOLDLINE.

Various examples of HELP queries are shown following. The contents of HELP returns are explained in the following subsections.

Note that the format of the results shown in these examples may not always match the actual output.


Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide



Example 2: HELP TABLE

Example 3: HELP MACRO

Example 4: HELP COLUMN

The following statement returns the following information about the Personnel database.:


Table/View/Macro Name Kind Comment Protection Creator Name Department T F Administration

The following statement returns information about the Department table.

HELP TABLE Personnel.Department;

Column Name Type Comment

DeptNo I2 Department number

DeptName CV Department name

Loc CF Department location

MgrNo I Employee number of department manager

The following statement returns information about the NewEmp macro.


Parameter Name Type Comment

Name CV Employee name, last name first;required

Number I Employee number; required

Dept I2 Department number; required

The following statement requests information about particular columns in the Employee and Department tables (note that each column reference is fully qualified with its table name):

HELP COLUMN Employee.Name, Employee.DeptNo,


FROM Employee, Department ;

The return from the preceding query lists each column in the order in which it was specified; therefore, the first DeptNo column listed is for the Employee table, the second is for the Department table:

Column Name Type Nullable

Name CV N

DeptNo I2 Y

DeptNo I2 N

Teradata RDBMS for UNIX SQL Reference

Teradata SQL Syntax Guide


Example 5: HELP INDEX



Example 8: Formatting HELP Results

The response to the following statement shows that one index is defined for the Department table.

HELP INDEX Personnel.Department;



Unique Secondary Column Names Index Id Approximate Count

Y P DeptNo 1 7

If COLLECT STATISTICS is in effect for the Employee table, this statement may be used to obtain current Employee statistics:

HELP STATISTICS Personnel.Employee;

The result shows that statistics were last collected for YrsExp on 85/06/17, when there were 17 unique values for the column:

Date Time Unique Values Column Names

85/06/17 13:12:45 17 YrsExp

The following statement shows the current attributes of the user’s session.


User Account Logon Logon Current Collation Character

Name Name Date Time DataBase Set

Unm1 DBC 89/05/26 09:49:09 Unm1 EBCDIC EBCDIC

HELP results may be formatted. For example, this BTEQ input returns session information as demonstrated by the following report.


User Name Account Name Logon Date Logon Time Current DataBase Collation Character Set Transaction Semantics
Previous << 1 .. 154 155 156 157 158 159 < 160 > 161 162 163 164 165 166 .. 241 >> Next