The following session parameters can be controlled with keywords or predefined system variables.
Parameter | Valid Keywords or System Variables |
---|---|
SQL Flagger | ON |
OFF | |
Transaction Mode | ANSI (COMMIT) |
Teradata (BTET) | |
Session Collation | ASCII |
EBCDIC | |
MULTINATIONAL | |
HOST | |
CHARSET_COLL | |
JIS_COLL | |
Account and Priority | Account and reprioritization. See Teradata® Viewpoint User Guide, B035-2206 and Teradata Vantage™ - Workload Management User Guide, B035-1197. |
Date Form | ANSIDATE |
INTEGERDATE | |
Character Set | Indicates the character set being used by the client. You can view site-installed client character sets from DBC.CharSetsV or DBC.CharTranslationsV. The following client character sets are permanently enabled:
|
SQL Flagger
When enabled, the SQL Flagger assists SQL programmers by notifying them of the use of non-ANSI and non-entry level ANSI/ISO SQL syntax.
Enabling the SQL Flagger can be done regardless of whether you are in ANSI or Teradata session mode.
To set the SQL Flagger on or off for BTEQ, use the .SET SESSION command.
To set this level of flagging … | Set the flag variable to this value … |
---|---|
None | SQLFLAG NONE |
Entry level | SQLFLAG ENTRY |
Intermediate level | SQLFLAG INTERMEDIATE |
To set the SQL Flagger on or off for embedded SQL, use the SQLCHECK or -sc and SQLFLAGGER or -sf options when you invoke the preprocessor.
If you are using SQL in other application programs, see the reference manual for that application for instructions on enabling the SQL Flagger.
Transaction Mode
You can run transactions in either Teradata or ANSI session modes and these modes can be set or changed.
To set the transaction mode, use the .SET SESSION command in BTEQ.
To run transactions in this mode … | Set the variable to this value … |
---|---|
Teradata | TRANSACTION BTET |
ANSI | TRANSACTION ANSI |
If you are using SQL in other application programs, see the reference manual for that application for instructions on setting or changing the transaction mode.
Session Collation
Collation of character data is an important and complex option. Teradata provides several named collations. The MULTINATIONAL and CHARSET_COLL collations allow the system administrator to provide collation sequences tailored to the needs of the site.
The collation for the session is determined at logon from the defined default collation for the user. You can change your collation any number of times during the session using the SET SESSION COLLATION statement, but you cannot change your default logon in this way.
Your default collation is assigned via the COLLATION option of the CREATE USER or MODIFY USER statement. This has no effect on any current session, only new logons.
Each named collation can be CASESPECIFIC or NOT CASESPECIFIC. NOT CASESPECIFIC collates lowercase data as if it were converted to uppercase before the named collation is applied.
Collation Name | Description |
---|---|
ASCII | Character data is collated in the order it would appear if converted for an ASCII session, and a binary sort performed. |
EBCDIC | Character data is collated in the order it would appear if converted for an EBCDIC session, and a binary sort performed. |
MULTINATIONAL | The default MULTINATIONAL collation is a two-level collation based on the Unicode collation standard. Your system administrator can redefine this collation to any two-level collation of characters in the LATIN repertoire. For backward compatibility, the following are true:
This definition is not compatible with MULTINATIONAL collation of non-KANJI1 data. CHARSET_COLL collation is usually a better solution for KANJI1 data. |
HOST | The default. HOST collation
defaults are:
|
CHARSET_COLL | Character data is collated in the
order it would appear if converted to the current client character
set and then sorted in binary order. CHARSET_COLL collation is a system administrator-defined collation. |
JIS_COLL | Character data is collated based on
the Japanese Industrial Standards (JIS). JIS characters collate in the following order:
|
Account and Priority
You can dynamically downgrade or upgrade the priority for your account.
Priorities can be downgraded or upgraded at either the session or the request level. See Teradata® Viewpoint User Guide, B035-2206 and Teradata Vantage™ - Workload Management User Guide, B035-1197.
Date Form
You can change the format in which DATE data is imported or exported in your current session.
DATE data can be set to be treated either using the ANSI date format (DATEFORM=ANSIDATE) or using the Teradata date format (DATEFORM=INTEGERDATE).
Setting the Client Character Set
- From BTEQ, use the BTEQ [.] SET SESSION CHARSET 'name' command.
- In a CLIv2 application, call CHARSET name.
- In the URL for selecting a Teradata JDBC driver connection to a database, use the CHARSET=name database connection parameter.
where the ‘name’ or name value is ASCII, EBCDIC, UTF-8, UTF-16, or a name assigned to the translation codes that define an available character set.
If not explicitly requested, the session default is the character set associated with the logon client. This is either the standard client default, or the character set assigned to the client by the database administrator.
HELP SESSION
- Transaction mode
- Character set
- Collation sequence
- Date form
- Queryband
Related Information
- Using the SQL Flagger, see Using the SQL Flagger.
- Character sets, see Teradata Vantage™ - Advanced SQL Engine International Character Set Support, B035-1125.
- Transaction semantics, see Teradata Vantage™ - SQL Request and Transaction Processing, B035-1142.
- MULTINATIONAL, see the information about the ORDER BY clause in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.
- Information on setting up the MULTINATIONAL collation sequence, see Teradata Vantage™ - Advanced SQL Engine International Character Set Support, B035-1125.
- For examples of the following statements, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
- SET SESSION COLLATION
- SET SESSION ACCOUNT
- SET SESSION DATEFORM
- HELP SESSION