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 .. 20 21 22 23 24 25 < 26 > 27 28 29 30 31 32 .. 241 >> Next


The internal forms used for European and Japanese character support are described in Appendix E through Appendix J.

Japanese character (Kanji) code notation used in this manual is described in Chapter 1, “Notation.”

Note: The ASCII code mentioned in this manual is based on Standard ASCII, but includes some Teradata extensions. See Appendix G, “International and Japanese Character Support,” Table G-1, “Teradata Internal Form for International Character Support”, and Appendix E, “ASCII Hexadecimal Translation Tables”.

Teradata RDBMS for UNIX SQL Reference

4-1
Teradata SQL Lexicon

Words and Names (Non-Japanese Character)

Words and Names (Non-Japanese Character)

The definitions of words and names in this section pertain to the IntrOduCtiOn ASCII character set (non Japanese character set). The definitions and

rules for using Japanese character names are described in the following sections.

Words consist of strings of 1 to 30 characters, chosen from the Words following set:

• Uppercase or lowercase letters (A to Z and a to z).

• Digits (0 through 9).

• The special characters dollar sign ($), pound sign (#), and underscore (_ ).

• A word must begin with a letter.

A word may be either a name or a keyword. A word is a name that is not in double quotes.

Note: Words with lower case letters, ($), (#), beginning with an underscore, or more than 18 characters in length, are flagged as not entry level ANSI when the SQL flagger is enabled.

A name is a word that is not a keyword or a set of characters in double Names quotes. Passwords and account identifiers are also considered to be

names. Names must meet the requirements defined above for words.

Names that define databases and objects must follow these rules:

• Databases cannot have identical names.

• Tables, views, or macros in a database cannot have identical names.

• Columns of a table or view cannot have identical names.

• Parameters defined for a macro cannot have identical names.

• Two indexes on a table cannot have the same name.

• Two constraints on a table cannot have the same name.

• Indexes and constraints can have the same name as the table they are in.

You must define and reference each object (user, database, table, column, view, macro, and checkpoint) by a symbolic name.

4-2

Teradata RDBMS for UNIX SQL Reference
Use of Quotation Marks

Caution:

Teradata SQL Lexicon

Words and Names (Non-Japanese Character)

CHECK constraints, REFERENCE constraints, and INDEX objects, may also have assigned names. For these objects, names are optional.

A name is stored as a string of hexadecimal bytes. The maximum length of a name is 30 bytes.

Although unquoted multiword names with blanks are not supported, an existing database or object that was created with such a name may still be referenced by enclosing its name in quotation marks.

For example:

"Current Salary"

Note: Multi-word names and blanks are supported if they are quoted.

Quotation marks may also be used to support any nonstandard name, such as one that contains special characters.

For example:

"D'Agusta"

The quotation marks are not part of the name; they are required, however, if the name is not a valid word.

Examples of valid names are:

Employee

job_title

CURRENT_SALARY

DeptNo

Population_of_Los_Angeles

Totaldollars

"Table A"

"Today's Date"

If you use quoted names, the double quote characters that delineate the names are not counted in the length of the name and are not stored in Dictionary tables used to track name usage.

If a Dictionary view is used to display such names, they are displayed without the double quote characters, and if the resulting names are used, without adding double quotes, the likely outcome is an error report.

In the example above, “D’Augusta” may be the name of a column in the Dictionary view DBC.Columns and the HELP statements that return column names return the name as D’Augusta (without being enclosed in double quotes).

Teradata RDBMS for UNIX SQL Reference

4-3
Teradata SQL Lexicon

Words and Names (Non-Japanese Character)

Case-Dependence

Use of TITLE Phrase

Names are not case-dependent; a name may not be used twice simply by changing its case. Any mix of upper- and lower-case may be used when referencing symbolic names in a request.

For example, the following statements are considered to be identical:

SELECT Salary FROM Employee WHERE EmpNo = 10005;

SELECT SALARY FROM EMPLOYEE WHERE EMPNO = 10005;

SELECT salary FROM employee WHERE eMpNo = 10005;

The case in which column names are defined can be important. The

column name is the default title of an output column, and symbolic names are returned in the same case in which they were defined.

For example, assume that the columns in the SalesReps table are defined as follows:

CREATE TABLE SalesReps ( last_name VARCHAR(2 0) NOT NULL,

first_name VARCHAR(12) NOT NULL, ...
Previous << 1 .. 20 21 22 23 24 25 < 26 > 27 28 29 30 31 32 .. 241 >> Next