Teradata Call-Level Interface Version 2 for Workstation-Attached Systems | 20.00 - Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems - 20.00 - Call-Level Interface Version 2
Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Call-Level Interface Version 2
Release Number
20.00
Published
January 2024
Language
English (United States)
Last Update
2024-08-14
dita:mapPath
bmn1691484839905.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
fvz1470444150352
Product Category
Teradata Tools and Utilities
Introduction to CLI
Welcome to Teradata Call-Level Interface Version 2 Reference for Workstation-Attached Systems
Overview
Prerequisites
Release Version Compatibility
What is CLIv2?
CLI Design Goals
Supported Operating Systems
Interface Overview
Logical Structure
Calling CLI Directly
CLI Data Structures
DBCAREA
DBCAREA Extensions
System Parameter Block
Session Control Block
Request Control Block
MTDP Control Block
Communicating with the Database
Sessions
Teradata Partitions
Requests and Responses
Parcels
Large Objects
Executing Programs in the Database
All-Or-Nothing Property
Statements and Transactions
Teradata Transaction Semantics
ANSI Transaction Semantics
Parallel Database Operations
Multi-Statement Management
Multi-Thread Management
Multi-Session Management
Using Fetch
Considering Alternative Approaches
Common Routines Supporting CLI
DBCHINI
DBCHCL
DBCHCLN
Using the DBCAREA
One DBCAREA
Multiple DBCAREAs
Setting Alarms and Signals
Handling Password Expiration
Submitting a New Password
Session Operations
Overview
Preparing to Use CLI
DBCHINI
How Many DBCAREAs to Use?
Setting/Using the DBCAREA Options
Change Options
Establishing a Session
Executing a Startup Request
Submitting a Request
Fetching the Response
No Rewinding, Single Buffering
Rewinding, Single Buffering
No Rewinding, Double Buffering
Rewinding, Double Buffering
Repositioning, Single Buffering
Repositioning, Single/Double Buffered LOB Data
Continuing a Teradata SQL Request
Ending a Request
Aborting a Transaction
Aborting a Request
Aborting a LOB Request: Example
Aborting a Request: Example
Terminating a Session
Cleaning Up CLI
Single Session Example
Multiple Session Example
Options Processing
Setting Change Options to Y
Setting Change Options to N
CLI Files and Setup
Finding CLI Files on the System
Required Files for UNIX Platforms
Required Files for Windows Platforms
Required Files for the Apple macOS Platform
Required Files for All Platforms
CLI Environment Variables
CLI_COPS
CLI2EXITLVL
COPLIB
COPANOMLOG, NETRACE, THREADLOGGING, and THREADONOFF
SSLMODE, SSLCA, SSLCAPATH, SSLCRC
TDMSTPORT and TDMSTTLSPORT
TCP_BUF_SIZE
System Parameter Block (SPB) Processing
Using the COPLIB Variable
Internal SPB
System Parameter Block (SPB) File
Accessible SPB
Accessing clispb.dat
If clispb.dat is Missing
Caveats
The clispb.dat Listing
Overriding Values
Reformatted File: Example
Valid Item Specifiers
Values Used by CLI: Summary
Initial Values
Final Values
DBCAREA
DBCAREA Fields
Allocating the DBCAREA
DBCAREA Security Mechanism Fields
Network CLIv2 User Exits
Supported Mechanisms
Integrity and Compatibility
Other Mechanisms
Determining Session Username
Default Mechanism Handling
Unicode Credential Processing
DBCAREA: Field Descriptions
Individual Field Descriptions: Alphabetical Listing
Automatic-redrive
Changing the Value for Automatic-redrive
Change Options
Character Set Pointer
Character Set Type
Changing the Value for Character Set Type
Column Title and Format Information
Changing the Value for Column-info
Connect Wait
Connection String Length
Connection String Pointer
Consider APH Responses
Continuation Code
Changing the Value for Continuation Code
Current Request Buffer Length
Current Response Buffer Length
Data Encryption
Changing the Value for Data Encryption
Date Form
Changing the Value for Date Form
DBC Level
Dynamic Result Sets Allowed
Extended-Load-Usage
Extension Pointer
Exempt Session from DBCHWAT
Eyecatcher
Fetch Data Pointer
Fetch Data Pointer, Move Mode
Fetch Data Pointer, Locate Mode
Fetch Error Indicator
Fetch Maximum Data Length
Fetch Parcel Flavor
Fetch Returned Data Length
Function
Input DBCpath
Input Request Id
Input Session Id
Keep Response
Changing the Value for Keep Response
Language Conformance
Language Id
Changing the Value for Language Id
Large Row
Changing the Value for Large Row
Locate Mode
Changing the Value for Locate Mode
Logon Length
Logon Pointer
Logon Mechanism Data Length
Logon Mechanism Data Pointer
Logon Mechanism Name
Logon Timeout
Maximum Decimal Precision
Maximum Number Of Sessions for a Single Process
Maximum Parcel
Changing the Value for Maximium Parcel
Determining Maximum Parcel Request Size
Maximum Single LOB
Maximum Size of Total LOBs Per Row
Message Area Length
Message Area Pointer
Message Charset Used
Message Length
Message Length Returned
Message Return Code
Message Text
MTDP Received
MTDP Sent
Multi-Statement-Errors
Output DBC Session Id
Output DBCpath
Output Host Id
Output Request Id
Output Server Port
Output Session Id
Output SSLMODE
Parcel Mode Fetch
Changing the Value for Parcel Mode Fetch
Period-as-Struct
Positioning-action
Positioning-statement-number
Positioning-value
Request Buffer Length
Request Length
Request Mode
Changing the Value for Request Mode
Request Pointer
Example
Request Processing Option
Changing the Value for Request Processing Option
Response Buffer Length
Using CLICON
Response Mode
Return Code
Return Identity Data
Return Object
Changing the Value for Return Object
Return Statement Info
Return Time
Changing the Value for Return Time
Run Length
Run Pointer
Segment Data
Changing the Value for Segment Data
SSLMODE
Statement-status
Stored Procedure Return Result
TASM FastFail Request
Tell About Delay
Changing the Value for Tell About Delay
APRC and Tell About Delay
Used with Wait Across Delay
Time1
Time5
Timing Precision
Time1 Status
Time5 Status
Token
Total Length
Transaction Semantics
Changing the Value for Transaction Semantics
Transforms-off
Trusted-request
Two Response Buffers
Changing the Value for Two Response Buffers
Use Presence Bits
Changing the Value for Use Presence Bits
using-data-count
Using Data Length
Using Data Length Array
Using Data Pointer
Using Data Pointer Array
Utility Workload
Variable Length Fetch
Changing the Value for Variable Length Fetch
Variable Length Request
Changing the Value for Variable Length Request
Wait Across Delay
Changing the Value for Wait Across Delay
APRC and Wait Across Delay
Used with Tell About Delay
Wait For Response
Changing the Value for Wait for Response
Wait Timeout
Workload Length
Workload Pointer
XML Response Format
DBCAREA Fields Not Used by Workstation-Attached Systems
DBCAREA Extensions
Overview
Initiate-request Extensions
Usage Notes
Header
Elements
Initiate-request Extensions Fields
Data Address
Data Length
Data Size
Element Length
Element Type
EyeCatcher
Level
Next Pointer
Parcel Flavor
Total Length
Total Size
Connect extension (DBCACNX)
DBCACNX Fields
Common Routines
Overview
Introduction
Use
Parameters
DBCHINI
DBCHCL
DBCHCL Functions
DBFCON
DBCAREA Parameters
Asynchronous Connects
Single Sign-On
Default Connection
DBFCRQ
DBFRSUP
DBCAREA Parameters
DBFIRQ
DBCAREA Parameters
DBFABT
DBCAREA Parameters
DBFFET
DBCAREA Parameters
DBFREW
DBCAREA Parameters
DBFERQ
DBCAREA Parameters
DBFDSC
DBCAREA Parameters
DBCHCLN
Other CLI Routines
Overview
Use
Parameters of CLI Routines: Tabular Summary
DBCHERR
DBCHFER
DBCHFERL
DBCHPEC
DBCHQE
DBCHREL
DBCHSAD
DBCHUE
DBCHUEC
DBCHWAT
DBCHWL
Parcels
Overview
Structure
Parcel Structure
Flavor Field
Length Field
Parcel Body
Parcel Types
Request Parcels: Overview
Response Parcels: Overview
Common Parcel Fields
Data Type
Activity Type
Parcel Descriptions
Abort
Abrt2PC
Assign
AssignRsp
Cancel
Cmmt2PC
Connect
CursorDBC
CursorHost
Data
DataInfo
DataInfoX
ElicitData
ElicitDataReceived
ElicitFile
EndMultipartData
EndMultipartIndicData
EndMultipartRecord
EndRequest
EndStatement
EndWith
Error
ErrorInformation
ExtendedKeepRespond
ExtendedRespond
Failure
Field
Flagger
FMReq
FMRunStartup
FormatEnd
FormatStart
IndicData
IndicReq
IVRunStartup
KeepResp
KeepRespond
Logoff
Logon
MultipartData
MultipartIndicData
MultipartRecord
MultipartRequest
Multi-TSR
NOP
NullField
OffsetPosition
OK
Options
PosEnd
Position
PosStart
PrepInfo
PrepInfoX
RecEnd
Record
Record (In Indicator Mode)
Record (In Record Mode)
RecStart
Req
Resp
Respond
ResultSet
ResultSet Cursor
ResultSummary
Rewind
RowPosition
Run
RunResponse
RunStartup
SessionOptions
Setposition
Size
SizeEnd
SizeStart
SP Options
StatementError
StatementInformation
Parcel Data
StatementInformationEnd
StatementStatus
Parcel Data
Success
TitleEnd
TitleStart
UserNameRequest
UserNameResponse
VoteRequest
VoteTerm
With
Response Sequences
Overview
The Request Buffer
Allocating the Request Buffer
Values
Maximum Length
The Response Buffer
Making It Available
Replenishing the Response Buffer
Holding Error or Failure Parcels
Sending “Buffer-fulls”
Setting Save Response Buffer
Double Buffering
One Request at a Time
The Move Area
Typical Response Sequences
Sending the Response
Screening the Response
Consuming the Response
Parcels That Indicate Problems
What Error Parcels Indicate
What Failure Parcels Indicate
Failures During Multi-Statement Requests
Parcels in Normal Sequence
Response Sequences: Field Mode
Response Sequences: Indicator Mode
Response Sequences: Multipart Indicator Mode
Response Sequences: Record Mode
Parcel Sequences
Session Control: Logon
Issuing Requests: Field Mode
Issuing Requests: Indicator Mode
Issuing Requests: Multipart Indicator Mode
Examples
Issuing Requests: Record Mode
Return, Error, and Failure Codes
Overview
Code Sources
Return Code Values and Code Types
What Code Values Mean
Information Messages
Problem Messages
Coding Messages
Return Codes That Do Not Reach the Application
Timing of Return Codes
Examples
Error and Failure Codes
Saving the Request
Responding to Error and Failure Parcels
Checking Both Code Sources
Crash and Recovery
Overview
Handling Crashes
If the Workstation-Attached System Crashes
If An Internal Error is Detected
What the Database Does
What MTDP Does
Recovery Flags
AP Reset Containment (APRC)
Value of APRC
Crash Option Aliases
What APRC Does
Enabling/Disabling APRC
What the Application May Do
Case 1: Tell and Wait
Case 2: Just Wait
Case 3: Just Tell
Stored Procedures
Introduction
Description
Send Procedure to the Database
Response Processing
Abort, Cancel, and Restart Processing
Effects on Other Options
Alternate Parcel Header
Introduction
Alternate Parcel Header Structure
Client Interface Changes
Applications Using Parcel Mode
APH Parcels Sent to CLI Using the Extension Area in Parcel Mode
Using the New Element Structure
Inline:
Pointed to:
Members of New Structure Elements
Possible Combination of Element Structures
For Applications using Buffer Mode
New CLI Errors with APH Implementation
Handling Variable Length Requests
Others
Extended Message Response Size
Overview
Existing Scenario
Applications using Parcel mode (request_mode='P')
Applications using Parcel mode (request_mode='B')
Limitation in Extending the Existing Scenario
CLI - Client Interface Changes
Applications using Parcel mode (request_mode='P')
Applications using Parcel mode (request_mode='B')
CLI Exit Functions
Overview
Use
Parameters of CLI Exit Routines
CliUsrLgnExt
Internal Variable
Interface
Return Value
Error Handling
CLI Pre- and Post-Process SQL User Exits
Internal Variable
CliPreSQLExt
CliPostSQLExt
User Exits for Security
Level 2 Login and Pre & Post Exits
CliLgnExit2
CliSQLExit2
CLI2EXITLVL Environment Variable
Large Objects (LOB) Support
Introduction
Determining LOB Support
Inline Method
Server to Client Transfer
Client to Server Transfer
Deferred Method
Server to Client Transfer
Client to Server Transfer
Summary
Error Messages and Codes
How to Secure Connections using TLS
Overview
About TLS in Client Applications
TLS Connections and DBCHQE
Certificate Revocation Status Checking
TLS Certificate Stores
SSLCA
SSLCAPATH
SSLCRC
SSLPROTOCOL
Troubleshooting
Proxy Server Support
Configuration of a Proxy Server
Connection String
Environment Variables
Performance Measurement
Overview
Example
IBM z/OS Mainframe Support
Overview
Limitations
System Parameter Block (SPB) File: clispb.dat
Error message catalog file: errmsg.cat
TLS 1.2 Support
Identity Token Support
Overview
Requirements
RACF (SAF) Classes for Identity Token Support
IDTPARMS Class
Teradata Recommendation: IDTDATA Class Profile Format
IDTPARMS Segment
CRYPTOZ Class
Teradata Recommendation: CRYPTOZ Class Profile Format
CRYPTOZ Permissions Required
PTKTDATA Class
CSFSERV Class
Identity Token SETUP
CREATE EXAMPLE
LIST TOKEN EXAMPLE
LIST TOKEN OUTPUT EXAMPLE
Certificate Binding
Certificate Generation
Certificate Binding Process
EXPORT Certificate
Token Verification
Identity Token Authorization
Identity Token Authorization Configuration
RACFJWT Class Profiles
APF-AUTHORIZATION
Create database USER ID
Configure IBM z/OS Client
Configure Teradata Vantage Server for IDT Support
Connection Mechanism “RACFJWT’ for IDT Support and Logon String
JESMSGLG DD - Return code and messages
Error Codes Relating to IDT Support
Troubleshooting
Overview
CLI Trace File
Compiler Versions
Examples of Using DBCAREA Extension Elements
Sending TDSP Options Parcel
Using 64-bit Implementation-Defined Extension Elements
Sending TDSP Options Parcel Using APH Defined Extension Elements
Sending a Parameterized SQL Using APH Defined Extension Elements
Example of Setting up "using_data_ptr_array" in DBCAREA
Using Multiple Using Data Records
Mainframe TLS Connectivity Supplement
Outline
Enable TLS Connectivity on Teradata Vantage
Attain Teradata Vantage TLS Certificate(s)
Load Server Certificate(s) into Mainframe Certificate Store
Mainframe Client Certificate Store
Configure CLI to Reference Key Ring and Use TLS
Verify TLS Connectivity
Create a Sample Key Database File on z/OS
Additional Information
Audience
Changes and Additions
Teradata Links
Related Documentation