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 .. 200 201 202 203 204 205 < 206 > 207 208 209 210 211 212 .. 241 >> Next


Teradata SQL allows the following data type keyword variants:

• CHARS, and CHARACTERS for CHAR

• INT for INTEGER

• DEC for DECIMAL

These keywords and keyword variants are not reserved words in DB2.

In Teradata mode, the Teradata RDBMS allows abbreviations for many statements, such as:

• UPD for UPDATE

• DEL for DELETE

• SEL for SELECT

• CM for CREATE MACRO

Teradata SQL allows the user to insert comments in a statement by

either surrounding a comment with /*____*/ , or by starting each

comment line with a double dash “- -”. DB2 does not provide this feature.

Teradata SQL allows objects to have names up to 30 bytes which is longer than the limit imposed by DB2 of 18 bytes. See the section later, “Limitations: DB2 Vs. Teradata SQL”. Teradata RDBMS also performs name validation for Japanese character sets.

Teradata SQL data types not supported in DB2 are:

• BYTEINT

• BYTE(n)

• VARBYTE(n)

• NUMERIC

• REAL

C-20

Teradata RDBMS for UNIX SQL Reference
Comparing Teradata SQL and DB2

Teradata SQL Extensions Beyond DB2

BETWEEN...AND in Column Definitions

FORMAT, NAMED, TITLE Column Definition

Expressions

Teradata SQL allows the numeric constraint BETWEEN n1 AND n2 to be used in column definitions; DB2 does not.

In Teradata mode, Teradata SQL allows FORMAT, NAMED, and TITLE specifications to be included in a column definition; DB2 does not.

The following Teradata SQL expressions are not supported in DB2:

• Arithmetic operators ** and MOD

• SQRT, ABS, LOG, LN, NULLIFZERO, and ZEROIFNULL

• Character string functions of concatenation [available in DB2 Version 2 Release 2 and Version 3.0] and INDEX

• INTERSECT and MINUS operators

• Conversions between character and numeric data types.

• Teradata SQL supports the use of comparison operators and the [NOT] IN operator with subqueries and with set expressions; for example, Teradata SQL allows the following syntax:

(expr[,. ..]) operator [quantifier] (const,const
(expr[,. ..]) operator [quantifier] (subquery)
(expr[,. ..]) [NOT] IN (const,const, ... )
(expr[,. ..]) [NOT] IN (subquery)

DB2 supports comparison operators only with subqueries.

• Case-independent comparisons

• Built-in values of DATE and TIME.

• Date and Time expressions, including the EXTRACT function, e.g.,

EXTRACT (YEAR FROM DATE);

EXTRACT (HOUR FROM date_value);

• ADD_MONTHS function allows the adding or subtracting of months or years from a date, e.g., to get the date 6 months ago:

ADD_MONTHS (DATE, -6)

• DEFAULT phrase, which allows the user to define the value to be supplied for a column when an insert value is not specified. In addition, that definition may be one of the built-in values (DATE, TIME, or USER).

• Column attribute functions TYPE, TITLE, NAMED, FORMAT, CHARACTERS, and BYTES.

• String functions MSUBSTR, MINDEX, MCHARACTERS, OCTET_LENGTH, and CHAR2HEXTINT.

Teradata RDBMS for UNIX SQL Reference

C-21
Comparing Teradata SQL and DB2

Teradata SQL Extensions Beyond DB2

Data Handling

Statements

The following data handling features are not supported in DB2.

• Macros and EXECUTE [macroname]

• Drop columns and/or modify column attributes in an existing table

• DROP MACRO, DROP STATISTICS, DROP USER

• Teradata SQL treats all variable-length character columns the same, regardless of their maximum length. DB2 introduces a variety of restrictions on DML operations involving variable-length character columns with a maximum length which is greater than 254 (DB2 calls such columns “long string columns”).

• SHOW TABLE, SHOW MACRO, SHOW VIEW

• COLLECT STATISTICS

• GIVE

This command transfers ownership of a database or a user space to another user.

• HELP

The following statement extensions are not supported in DB2.

• WITH/BY clauses in a SELECT statement. WITH clause is supported in DB2 Version 4.

• Hexadecimal notation of object names in the form ’--’XN.

• Multi-statement Requests

Teradata RDBMS can receive two or more Teradata SQL statements in one request and handle them in parallel (DELETE, INSERT, UPDATE)

• RENAME

This command renames the following existing objects: MACRO, TABLE, VIEW

• REPLACE MACRO (in Teradata mode), REPLACE VIEW

C-22

Teradata RDBMS for UNIX SQL Reference
Comparing Teradata SQL and DB2

Reserved Words Comparison

Introduction

DB2 Reserved Words

Reserved Words Comparison

The reserved word lists of DB2 and Teradata SQL differ greatly.

This section lists the reserved keywords defined in DB2 but not in Teradata SQL; Table C-2 lists reserved keywords defined in Teradata SQL but not in DB2.

The following are reserved words in DB2 (Version 2 Release 2.0), and not in Teradata SQL:

• END-EXEC (COBOL only)

• EDITPROC

• FIELDPROC

• VALIDPROC

The following are reserved words in DB2 (Version 3), and not in Teradata SQL:

• COLLECTION

• CONCAT

• OBID
Previous << 1 .. 200 201 202 203 204 205 < 206 > 207 208 209 210 211 212 .. 241 >> Next