Explicit Connection - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide

Product
Teradata Preprocessor2
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-19
dita:mapPath
whb1544831946911.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

Explicit connection permits precise control over which tdp and userid to connect to. Implicit connection uses system defaults for the tdp and userid. (See Implicit Connection). For this reason, make an explicit connection to connect to a nondefault tdp or userid.

Explicit connections are generally advocated because of this precise control, even when default tdps and userids are satisfactory for the required level of security.

Specify an explicit connection to the database with a CONNECT or LOGON statement, which are described in Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 .

Statement Specifications
CONNECT Specify only the userid and password. The tdpid is taken from the system default value.

The CONNECT userid and password are each restricted to eight characters.

This statement is IBM SQL-compatible.

LOGON Specify a complete database system logon string, including tdpid and accountid.

The userid and password each can be a maximum of 30 characters.

On Windows platforms only:

The <userid> and <password> are optional on Windows NT.

A LOGON string without a <userid> and <password> is interpreted as an SSO logon.

If an explicit connection request is made when a connection or a transaction is already active, the following actions are taken.

Connection or Transaction Status Action Taken
The application is already connected to the database. The previous connection is dropped before the new connection is attempted.
A transaction is active.
  • The connection request is rejected with a SQLCODE of -752.
  • The application must terminate the current transaction explicitly using one of the following before attempting to issue a new explicit connection request:

    COMMIT

    ROLLBACK (or ABORT)

    LOGOFF