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 .. 174 175 176 177 178 179 < 180 > 181 182 183 184 185 186 .. 241 >> Next

Teradata SQL Syntax Guide

ROLLBACK

ROLLBACK

Function

The ROLLBACK statement terminates the current transaction.

Syntax

ROLLBACK-

I-WORK-I L

quotestring-I I-FROM option -I I-WHERE option-I I-T-T

FF07A037

where:

Syntax Element ... Description
WORK ROLLBACK is flagged as non-entry level ANSI SQL if WORK is not present and the SQL flagger is enabled.
quotestring Specifies the text of the message to be returned when the transaction is terminated. This option is not ANSI SQL and is flagged if the SQL flagger is enabled.
FROM option This may be required if the WHERE clause includes subqueries. The contents of the FROM option are described in Chapter 7, “Queries: The sElECT Statement,” under the “FROM List”. This option is not ANSI SQL and is flagged if the SQL flagger is enabled.
WHERE clause An optional clause that introduces a conditional expression. The expression may specify an aggregate operation (see Usage Notes) under ABORT. If the WHERE clause is omitted, termination is unconditional. See also Chapter 7, “Queries: The SELECT Statement,” “WHERE Clause” The WHERE condition specifies an expression whose result must be true if termination is to occur. If the result is false, transaction processing continues. This option is not ANSI SQL and is flagged if the SQL flagger is enabled.

Teradata RDBMS for UNIX SQL Reference

8-243
Teradata SQL Syntax Guide

ROLLBACK

How ROLLBACK Works

ROLLBACK With BTEQ

The ROLLBACK statement performs the following actions:

Stage Process
1 Backs out changes made to the database as a result of the transaction.
2 Deletes spooled output for the request.
3 Releases locks associated with the transaction.
4 If the transaction is in the form of a macro or a multi-statement request, bypasses execution of the remaining statements.
5 Returns a failure response to the user.

Refer also to the “ABORT” statement.

If you use ROLLBACK in a BTEQ script with either the .SESSION or the .REPEAT command, you must send the ROLLBACK statement along with the repeated SQL statement as one request. If you send the repeated request without the ROLLBACK, one of the requests is eventually blocked by other sessions and the job will hang because of a deadlock.

8-244

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

SELECT

SELECT

The SELECT statement returns row data in the form of a result table.

Refer to Chapter 7, “Queries: The SELECT Statement,” for more detail.

Teradata RDBMS for UNIX SQL Reference

8-245
Teradata SQL Syntax Guide

SET SESSION COLLATION

SET SESSION COLLATION

The SET SESSION COLLATION statement overrides the collation currently in effect for the session.

SET SESSION is flagged as non-ANSI, when the SQL flagger is enabled.

Syntax

-I-SET SESSION^— COLLATION'-----SS-------1

ASCII ¦ EBCDIC-

TT

-MULTINATIONAL----- HOST------

FF07A038

where:

Syntax Element ... Specifies that. . .
ASCII comparison and sort operations use ASCII collation.
EBCDIC comparison and sort operations use EBCDIC collation.
MULTI- NATIONAL comparison and sort operations use a European (diacritical) character or Kanji character sort sequence (see Usage Notes).
HOST collation for the session agrees with the collation of the logon client system. This is the default.

SET SESSION is not allowed in 2PC sessions.

SET SESSION Is Not Valid

for 2PC Session Collation. The collation for a session determines the ordering of data

characters during comparison operations, and when sorting data in response to a SELECT request that includes a WITH...BY or ORDER BY clause.

COLLATION can be defined as an attribute of the user (see also Defining Colladon “CREATE USER” and “MODIFY USER”).

If the attribute is not defined, then collation for the session defaults to that of the logon client system.

8-246

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

SET SESSION COLLATION

The SET SESSION COLLATION statement defines collation after a session is started. Use the HELP SESSION statement to determine the default collation in effect for the current session.

The MULTINATIONAL option is useful only on a European Feature multInatIOnal Site or a Japanese character site.

MULTINATIONAL sets the collation for the session to an international sort sequence that is compatible with either a diacritical character set or a Japanese character set, as described under the ORDER BY clause of the SELECT statement.

Each international sort sequence is defined by the database administrator (and no check is made to ensure that collation is compatible with the character set of the current session) but multibyte character collation sequences cannot be changed.

The Teradata RDBMS converts data characters to their uppercase For Sorting and values for comparison and sorting operations unless the

Comparison, Characters CASESPECIFIC option is included in the SQL request, or was
Previous << 1 .. 174 175 176 177 178 179 < 180 > 181 182 183 184 185 186 .. 241 >> Next