Chapter 24 – Teradata (BTET) vs. ANSI Mode

"A bend in the road is not the end of the road unless you fail to make the turn."

-Anonymous

Teradata Mode (BTET) vs. ANSI Mode

Teradata systems have the ability to use either of these two modes:

•     Teradata mode

•     ANSI mode

image

Terms often associated with Transactions

A Statement is an SQL command that ends with a semi-colon.

A Request is one, or more, statements sent to the PE for execution.

A Transaction is one, or more, requests that take the database from one consistent state to another.

Every Teradata system comes with the ability to utilize Teradata mode or ANSI mode. Each mode has the ability to run the same commands, but knowing how the system will behave is key. Above are the fundamentals to concentrate on.

Both Modes Can Have Control Over The Commit Time

image

Above you can see how Teradata mode performs an implicit transaction on a single statement. You can compare that with the ANSI mode single statement request and see that a commit work is required. Actually, on the word Commit is required.

Multi-Statement Requests

image

You can see that both modes can perform a multi-statement request. Teradata mode requires a Begin Transaction or BT and an End Transaction or ET. Begin Transaction and BT mean the same thing. End Transaction and ET mean the same thing. That is why Teradata mode is often represented by BTET, but ANSI mode is always referred to as ANSI.

Rolling Things Back

image

Instead of committing the data you can perform a rollback, which sets things they way they were before the transaction began. In the previous page you saw commit and here you see rollback. Commit and rollback are your only two options here to either commit the data permanently or to perform a rollback.

Multi-statement Transactions Using BTEQ Semi-colons

image

By having another SQL command on the same line as the semi-colon (;), in BTEQ, they all become part of the same multi-statement transaction. Therefore, all are inserting into an empty table and it is much faster than doing each INSERT individually. You can utilize BTEQ and if the semi-colons are at the front of the line then this is another way of doing a multi-statement transaction in Teradata mode.

Case Sensitivity

image

Understanding how Teradata will treat case sensitivity is important. Remember though, you can always use the CASESPECIFIC (or CS) command if you want the case sensitivity.

What Happens If A Transaction Fails?

image

Understanding how Teradata will treat failed statements within a transaction is important.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset