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 .. 181 182 183 184 185 186 < 187 > 188 189 190 191 192 193 .. 241 >> Next


The use of 2PC protocol is supported. However, it is only supported for a Teradata mode session. It is not supported if the session is in ANSI mode.

If an attempt is made to use 2PC protocol in ANSI mode, the Logon process will be aborted and an error reported.

9-4

Teradata RDBMS for UNIX SQL Reference
Rules

Releasing Locks

Advanced SQL

ANSI Mode

ANSI Mode

The following rules hold in ANSI mode:

transaction initiation is always implicit.

a transaction is opened by the first SQL statement executed in a session or by the first statement executed following the close of a transaction.

a transaction is initiated when no transaction is currently active, and a SQL statement is executed.

The COMMIT [WORK] or ROLLBACK [WORK] statements close a transaction.

In entry level ANSI, the keyword WORK is required with COMMIT and ROLLBACK. Since Teradata RDBMS currently supports the word as optional for the ROLLBACK statement, it is also considered optional for the COMMIT statement. If the keyword WORK is omitted and the SQL flagger is enabled, then the statement is flagged as use of an extension.

When executing under ANSI mode, the Teradata RDBMS rolls back only the current request and not other statements previously executed in the transaction. There are no attempts to release any locks which may have been placed for a request that is rolled back.

The ABORT statement can be used in place of ROLLBACK. However, ABORT is flagged as non-ANSI when the SQL flagger is enabled.

an error result only rolls back a request.

control of character truncation of trailing non-blank characters causes errors (SUBSTRING should be used to prevent such errors).

by default, character comparisons are CASESPECIFIC.

MULTISET is the default in the CREATE TABLE statement i.e. by default, tables are created to allow duplicate rows.

by default, the TRIM function, TRIM (BOTH FROM expr) trims both leading and trailing blanks.

For other than transaction semantics, SQL can be written with explicit specifications to override defaults such that the SQL will execute the same in both ANSI and Teradata modes.

Teradata RDBMS for UNIX SQL Reference

9-5
Advanced SQL

Teradata Mode

Rules

A DDL Statement Must Be the Last Statement of a Transaction

Deadlocks

Teradata Mode

The following rules hold in Teradata mode:

transactions can be implicit.

transactions can be explicit (BT/ET).

statement failures roll back the entire transaction.

an error result rolls back the entire transaction.

control of character truncation causes no error.

the default in character comparison is NOT CASESPECIFIC.

SET is the default in the CREATE TABLE statement, i.e. by default, duplicate rows are not allowed when creating tables in Teradata mode.

the default, TRIM function, TRIM (TRAILING FROM expr), trims only trailing blanks.

The Teradata RDBMS enforces the rule that a DDL (Data Definition Language) statement must be the last statement of a transaction.

In addition, statements executed through a logon startup string will follow the rules for transaction definition and termination and the rule that a DDL statement must be the last statement of a transaction.

DATABASE and SET SESSION COLLATION statements are considered DDL statements.

Deadlock is a condition which is commonly accepted as a reason for system termination of a transaction. If an error is detected during execution of a request, the Teradata RDBMS rolls back the request only, not the transaction.

In ANSI mode, the entire transaction rolls back either when the current request would result in deadlock or when the current request contains a DDL statement and that statement aborts.

9-6

Teradata RDBMS for UNIX SQL Reference
Advanced SQL

SQL Flagger

SQL Flagger

The SQL flagger, when enabled, causes the Teradata RDBMS to flag lntroductioH any use of non-standard SQL. This always includes syntax and

dictionary lookup, and some semantic checks.

The SQL Flagger identifies ANSI SQL extensions that are provided by the Teradata SQL. It is intended to assist SQL programmers by providing a form of checking the SQL language for non-entry level ANSI syntax that is otherwise not an error.

Flagging is enabled by a host processor before a session is logged on, and is normally used only to check for ANSI compliance in scripts that must be portable.

To summarize, the SQL flagger does the following things:

Allows an application programmer to identify ANSI-conforming SQL language.

Checks for non-entry level ANSI SQL.

Analyzes the SQL language presented and checks for violations of any syntax rules.

Allows a statement flagged as non-entry level ANSI SQL, to still execute. Only a Warning message is returned. A Warning message does not terminate the SQL request.

By default, the SQL Flagger is disabled. The default transaction mode is typically Teradata mode, however, it follows the system default set for that session (the system default can be changed to ANSI mode).
Previous << 1 .. 181 182 183 184 185 186 < 187 > 188 189 190 191 192 193 .. 241 >> Next