The Teradata Database offers several types of help using an interactive client. For convenience, this reduces or eliminates the need to look information up in a hardcopy manual or on a CD-ROM. Therefore, using the help and show operations in this chapter can save you a large amount of time and make you more productive. Since Teradata allows you to organize database objects into a variety of locations, sometimes you need to determine where certain objects are stored and other detail information about them.
To see the database objects stored in a Database or User area, either of the following HELP commands may be used:HELP DATABASE My_DB ;
Since Teradata considers a database and a user to be equivalent, both can store the same types of objects and therefore, the two commands produce similar output.
Now that you have seen the names of the objects in a database or user area, further investigation displays the names and the types of columns contained within the object. For tables and views, use the following commands:HELP TABLE My_Table ;
The above outputs display the column name and the kind, which equates to the data type and any comment added to a column. Notice that a view does not know the data type of the columns from a real table. Teradata provides a COMMENT command to add these comments on tables and columns.
The following COMMENT command adds a comment to a table:COMMENT ON TABLE <table-name> 'This is the new table comment' ;
This COMMENT command adds a comment to a column:COMMENT ON COLUMN <table-name>.<column-name>
The above column information is helpful for most of the column types, such as INTEGER (I), SMALLINT (I2) and DATE (DA) because the size and the value range is a constant. However, the lengths of the DECIMAL (D) and the character columns (CF, CV) are not shown here. These are the most common of the data types
The next HELP COLUMN command provides more details for all of the columns:HELP COLUMN My_Table.*
The above output has been wrapped to show all the detail information available on the columns of a table.
The next chart shows HELP commands for information on database tables and sessions, as well as SQL and SPL commands:
The above chart does a pretty good job of explaining the HELP functions. These functions only provide additional information if the table object has one of these characteristics defined on it. The INDEX, STATISTICS and CONSTRAINT functions will be further discussed in the Data Definition Language Chapter (DDL) because of their relationship to the objects.
At this point in learning SQL, and in the interest of getting to other SQL functions, one of the most useful of these HELP functions is the HELP SESSION.
The following HELP returns information on the session from the PE:HELP SESSION ;
The above output has been wrapped for easier viewing. Normally, all headings and values are on a single line.
The current date form, time zone and everything that follows them in the output are new with the V2R3 release of Teradata. These columns have been added to make their reference here, easier than digging through the Data Dictionary using SQL.
When using a tool like BTEQ, the line is truncated. So, for easier viewing, the .SIDETITLES and .FOLDLINE commands show the output in a vertical display.
The next sequence of commands can be used within BTEQ:.sidetitles on
To reset the display to the normal line, use either of the following commands:.DEFAULTS
In BTEQ, any command that starts with a dot (.) does not have to end with a semi-colon (;).
The next HELP command returns a list of the available SQL commands and functions:HELP 'SQL';
The above output is not a complete list of the commands. The three dots in the center represent the location where commands were omitted so it fit onto a single page. All commands are seen when performed on a terminal.
Once this output has been used to find the command, than the following HELP command provides additional information on it:HELP 'SQL END TRANSACTION' ;
Since the terminal is used most of the time to access the database, take advantage of it and use the terminal for your HELP commands.
Tools like Queryman also have a variety of HELP commands and individual menus. Always look for ways to make the task easier.
Teradata Related Interview Questions
|Microstrategy Interview Questions||Informatica Interview Questions|
|MySQL Interview Questions||Oracle 11g Interview Questions|
|Hadoop Interview Questions||TeraData DBA Interview Questions|
|MYSQL DBA Interview Questions||Database Administration Interview Questions|
|DB2 SQL Programming Interview Questions||Hadoop Administration Interview Questions|
|Java Hadoop Developer Interview Questions||Informatica MDM Interview Questions|
|Informatica Admin Interview Questions||Hadoop Testing Interview Questions|
Teradata Related Practice Tests
|Microstrategy Practice Tests||Informatica Practice Tests|
|MySQL Practice Tests||Oracle 11g Practice Tests|
|Hadoop Practice Tests||TeraData DBA Practice Tests|
|MYSQL DBA Practice Tests||Database Administration Practice Tests|
|DB2 SQL Programming Practice Tests||Hadoop Administration Practice Tests|
Teradata Parallel Architecture
Fundamental Sql Using Select
On-line Help And Show Commands
Date And Time Processing
Character String Processing
Reporting Totals And Subtotals
Data Definition Language
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.