Teradata API
Teradata API
Teradata API
Purpose
The Teradata Tools and Utilities are a group of products designed to work with
the Teradata RDBMS. This book provides information on the Transparency
Series/Application Program Interface (TS/API) product. It includes an
overview of the product and its components, and it describes the operational
functions and features of the product.
The TS/API application program provides access to relational databases stored
on the Teradata RDBMS via a selected set of Independent Software Vendors
(ISV) products designed to retrieve data stored in DB2 or SQL/DS databases.
TS/API intercepts database requests from applications and passes them to the
Teradata RDBMS instead of to DB2 or SQL/DS. Data and error information are
returned to the application in the same format used by DB2 and SQL/DS.
Supported Releases
This book supports the following releases:
Teradata Database 12.00.00 (formerly RDBMS)
Teradata Tools and Utilities 12.00.00
TS/API 12.00.00
Date/Release Description
Audience
This book is intended for:
Application programmers
System operators and other database specialists
Prerequisites
You should be familiar with the following:
Basic concepts of the Teradata RDBMS
IBM systems concepts and terminology for MVS, CICS, or VM
DB2 or SQL/DS concepts and terminology
Teradata SQL concepts and terminology
How to use any other products in your installation for interfacing with
TS/API
List of Acronyms
The following acronyms are used in this book.
DB2 DATABASE 2
Preface
Purpose ............................................................................................................................... i
Supported Releases ........................................................................................................... i
Changes to this Book......................................................................................................... i
Audience............................................................................................................................. i
Prerequisites ...................................................................................................................... ii
Teradata Tools and Utilities Release Definition........................................................... ii
Technical Information on the Web................................................................................. ii
List of Acronyms .............................................................................................................iii
Chapter 1:
Introduction to TS/API
Overview of TS/API ....................................................................................................... 12
What is TS/API?........................................................................................................... 12
Benefits of TS/API ....................................................................................................... 12
What TS/API Supports ............................................................................................... 13
Prerequisite Knowledge .............................................................................................. 14
TS/API Usability ............................................................................................................. 15
How TS/API Functions............................................................................................... 15
TS/API, DB2, and Application Tools (CICS) ........................................................... 15
TS/API, DB2, and Application Tools (TSO)............................................................. 16
TS/API, SQL/DS, and Application Tools ................................................................ 17
Supported Environments ............................................................................................ 18
TS/API Certified Products............................................................................................. 19
Certified Products ........................................................................................................ 19
Accessing Teradata DBMS from Application Tools................................................. 110
Under MVS/CICS ...................................................................................................... 111
Under VM/CMS:........................................................................................................ 112
Query Management Facility ........................................................................................ 113
QMF Issues .................................................................................................................. 113
Statistical Analysis System (SAS)................................................................................ 116
SAS Features................................................................................................................ 116
SAS Issues .................................................................................................................... 117
NATURAL...................................................................................................................... 119
Chapter 2:
TS/API Installation and Customization
Control Flow Under TSO ............................................................................................... 22
Vectoring Enabled: Switching Between the Teradata RDBMS and DB2.............. 22
Vectoring Disabled: Teradata RDBMS Access Only ............................................... 23
Accessing TS/API Load Modules Under TSO and in Batch..................................... 25
Control Flow Under CICS .............................................................................................. 26
Accessing the TS/API Load Modules Under CICS.................................................... 27
Setting Up the Teradata RDBMS for TS/API.............................................................. 28
Teradata RDBMS Disk Space Requirements ............................................................ 28
BTEQ Scripts.................................................................................................................. 28
TS/API Databases ....................................................................................................... 28
Additional Sample Tables in the SQLDBA Database............................................ 210
Installing ISV Products ................................................................................................. 211
Open Support.............................................................................................................. 211
Certified Support - 03.04.00....................................................................................... 211
Certified Support - 03.04.00....................................................................................... 211
Preparing the ISV Product ........................................................................................... 212
Link-editing the Program .......................................................................................... 212
Converting Static SQL Into Teradata RDBMS Macros.......................................... 212
Setting Up the Teradata RDBMS.............................................................................. 213
The TERABIND Utility ................................................................................................. 214
JCL Example ................................................................................................................ 214
Usage Notes................................................................................................................. 215
QMF................................................................................................................................. 217
Run BTEQ Scripts ....................................................................................................... 217
Storing QMF Objects .................................................................................................. 218
Backing Up QMS Object Tables................................................................................ 218
Importing the QMS Object Tables............................................................................ 218
QMF Command Synonyms ...................................................................................... 219
QMF Suppporting BTEQ Scripts .............................................................................. 220
QKANJI Tables/Views .............................................................................................. 221
RDBMS Macros Created ............................................................................................ 221
QMF Release Dependencies...................................................................................... 222
SAS................................................................................................................................... 223
NATURAL...................................................................................................................... 224
RXSQL ............................................................................................................................. 225
Chapter 3:
Session Management
Specifying the Teradata RDBMS ................................................................................... 32
Under MVS/TSO and Batch ...................................................................................... 32
Under VM/CMS........................................................................................................... 33
Providing Logon Information ....................................................................................... 34
The DBCLOGON File/Table ...................................................................................... 34
The Logon Exit .............................................................................................................. 37
Chapter 4:
Product Management
MVS/TSO and Batch Products...................................................................................... 42
VM Products .................................................................................................................... 44
MVS/CICS Products....................................................................................................... 45
Chapter 5:
Problem Management
TS/API Debug Facility ................................................................................................... 52
DEBUG Directive.......................................................................................................... 52
DB2 Trace Facility............................................................................................................ 54
Turning the DB2 Trace On and Off............................................................................ 54
The OUTPUT and TRACE Files in MVS ..................................................................... 55
Allocating OUTPUT..................................................................................................... 55
Allocating TRACE ........................................................................................................ 55
The OUTPUT File in VM ............................................................................................... 56
The TSDB Debug Destination in MVS/CICS .............................................................. 57
OUTPUT Data Set......................................................................................................... 57
Master Terminal Commands ...................................................................................... 57
Basic Problem Determination (DEBUG SQL) ............................................................. 59
Interactive Application Debugging ........................................................................... 59
OUTPUT File Contents ................................................................................................ 59
Advanced Problem Determination (DEBUG ON) ................................................... 512
OUTPUT File Contents .............................................................................................. 512
Error Reporting Procedures......................................................................................... 513
Error Translations.......................................................................................................... 515
Error Translation Logic Strategy .............................................................................. 515
Chapter 6:
Static SQL and System Catalog Support
Static SQL Support .......................................................................................................... 62
Preparing a DB2 Application ...................................................................................... 62
Preparing an SQL/DS Application............................................................................ 65
TS/API Support of DB2 Static SQL ........................................................................... 67
TS/API Support of SQL/DS Static SQL.................................................................... 68
System Catalog Support ............................................................................................... 610
System Catalog Support ............................................................................................ 610
System Catalog Views................................................................................................ 610
System Catalog Tables ............................................................................................... 611
Long Teradata RDBMS Names................................................................................. 611
Authorization IDs....................................................................................................... 611
DB2 SYSIBM System Catalog Tables Emulation.................................................... 611
Chapter 7:
Command Syntax
SQL Differences ............................................................................................................... 72
Transaction Management............................................................................................... 73
DB2 or SQL/DS ............................................................................................................ 73
Teradata RDBMS .......................................................................................................... 73
Updatable Cursor Support ............................................................................................ 74
Non-Mapped Error Codes........................................................................................... 74
Syntax Mapping Strategy ............................................................................................... 75
DB2 Physical Database Structures ............................................................................. 75
SQL/DS Physical Database Structures...................................................................... 75
Referential Integrity ..................................................................................................... 76
Subqueries ..................................................................................................................... 76
SQL Reserved Word Conflicts .................................................................................... 76
FIELDPROC, EDITPROC, and VALIDPROC .......................................................... 76
DATE and TIME Functions......................................................................................... 76
Teradata SQL Extensions Differences .......................................................................... 78
Long Teradata SQL Names ......................................................................................... 78
The WITH Clause ......................................................................................................... 78
Sorting Nulls ................................................................................................................. 78
DB2 Syntax Mapping ...................................................................................................... 79
ALTER INDEX .............................................................................................................. 79
ALTER STOGROUP..................................................................................................... 79
ALTER TABLE .............................................................................................................. 79
ALTER TABLESPACE ................................................................................................. 79
COMMENT ON............................................................................................................ 79
COMMIT (WORK) ..................................................................................................... 710
CREATE ALIAS ......................................................................................................... 710
CREATE DATABASE ................................................................................................ 710
CREATE INDEX ......................................................................................................... 710
CREATE STOGROUP ................................................................................................ 710
CREATE SYNONYM ................................................................................................. 710
CREATE TABLE ......................................................................................................... 710
CREATE TABLESPACE ............................................................................................ 711
CREATE VIEW ........................................................................................................... 711
DELETE FROM........................................................................................................... 711
DROP............................................................................................................................ 711
EXPLAIN .................................................................................................................... 712
GRANT ....................................................................................................................... 712
INSERT ........................................................................................................................ 714
LABEL ON .................................................................................................................. 715
LOCK TABLE ............................................................................................................ 715
REVOKE .................................................................................................................. 715
ROLLBACK [WORK]................................................................................................. 715
SELECT ........................................................................................................................ 715
UPDATE ...................................................................................................................... 715
SQL/DS Syntax Mapping ............................................................................................ 716
ACQUIRE DBSPACE................................................................................................. 716
ALTER DBSPACE ...................................................................................................... 716
ALTER TABLE ............................................................................................................ 716
COMMENT ON ......................................................................................................... 716
COMMIT WORK (RELEASE)................................................................................... 717
CONNECT................................................................................................................... 717
CREATE INDEX ......................................................................................................... 717
CREATE SYNONYM ................................................................................................. 717
CREATE TABLE ......................................................................................................... 717
CREATE VIEW ........................................................................................................... 718
DELETE FROM........................................................................................................... 718
DROP ........................................................................................................................... 718
EXPLAIN ..................................................................................................................... 718
GRANT ........................................................................................................................ 718
INSERT......................................................................................................................... 719
LABEL ON .................................................................................................................. 719
LOCK ........................................................................................................................... 720
REVOKE ..................................................................................................................... 720
ROLLBACK WORK (RELEASE) .............................................................................. 720
SELECT ........................................................................................................................ 720
Appendix A:
Translation Tables
Error Codes...................................................................................................................... A2
Appendix B:
TS/API Catalog Emulation
Catalog Tables and Views ..............................................................................................B2
Catalog Emulation Table/View .................................................................................B2
SYSIBM .SYSCOLAUTH .............................................................................................B4
SYSIBM .SYSCOLUMNS.............................................................................................B5
SYSIBM.SYSCOPY........................................................................................................B7
SYSIBM .SYSDATABASE............................................................................................B8
SYSIBM .SYSDBAUTH ................................................................................................B9
SYSIBM.SYSDBRM.....................................................................................................B13
SYSIBM.SYSFIELDS ...................................................................................................B14
SYSIBM .SYSFOREIGNKEYS ...................................................................................B15
SYSIBM .SYSINDEXES ..............................................................................................B15
SYSIBM .SYSINDEXPART ........................................................................................B18
SYSIBM.SYSKEYS.......................................................................................................B20
SYSIBM.SYSLINKS.....................................................................................................B21
SYSIBM.SYSPLAN .....................................................................................................B22
SYSIBM .SYSPLANAUTH ........................................................................................B23
SYSIBM .SYSPLANDEP ............................................................................................B24
SYSIBM.SYSRELS .......................................................................................................B24
SYSIBM .SYSRESAUTH ............................................................................................B25
SYSIBM.SYSSTMT......................................................................................................B26
SYSIBM .SYSSTOGROUP..........................................................................................B26
SYSIBM .SYSSYNONYMS.........................................................................................B27
SYSIBM .SYSTABAUTH............................................................................................B27
SYSIBM .SYSTABLEPART ........................................................................................B31
SYSIBM.SYSTABLES..................................................................................................B33
SYSIBM .SYSTABLESPACE......................................................................................B37
SYSIBM .SYSUSERAUTH .........................................................................................B38
SYSIBM .SYSVIEWDEP .............................................................................................B40
SYSIBM.SYSVIEWS....................................................................................................B40
SYSIBM.SYSVLTREE .................................................................................................B41
SYSIBM .SYSVOLUMES............................................................................................B42
SYSIBM.SYSVTREE....................................................................................................B42
Emulation of the SQL/DS SYSTEM System Catalog Tables................................B43
SYSTEM.SYSACCESS ................................................................................................B44
SYSTEM .SYSCATALOG ..........................................................................................B45
SYSTEM .SYSCHARSETS..........................................................................................B47
SYSTEM .SYSCOLAUTH ..........................................................................................B48
Glossary...............................................................................................................Glossary1
Index.......................................................................................................................... Index1
Introduction to TS/API
Overview of TS/API
TS/API provides gateway services allowing products that access either DB2 or
SQL/DS databases to access data stored on the Teradata RDBMS. TS/API thus
lets you take advantage of both the convenient and easy-to-use data access
products and the tremendous storage capability and superior processing power
of the Teradata RDBMS.
TS/API works with Teradata RDBMS Version 1 and Version 2 (Teradata mode).
Any product that uses the IBM Call Attach Facility to access DB2 or SQL/DS
and does not use DB2- or SQL/DS-only constructs is a likely candidate for use
with TS/API. TS/API has been certified to support the following products:
SAS System, developed by SAS Institute, Inc.
Query Management Facility (QMF), developed by IBM
REXX programming language (via RXSQL requests ) developed by IBM
NATURAL, developed by Software AG.
See What TS/API Supports on page 1-3 and TS/API Certified Products on
page 1-9.
What is TS/API?
TS/API is an application program interface that allows you to access relational
databases stored on the Teradata RDBMS via a selected set of ISV (Independent
Software Vendors) products designed to retrieve data stored in DB2 or SQL/DS
databases. You do not need to know Teradata SQL in order to access this data.
TS/API intercepts database requests from applications and passes them to the
Teradata RDBMS instead of to DB2 or SQL/DS. Data and error information are
returned to the application in the same format used by DB2 and SQL/DS. By
using TS/API, a typical DB2 or SQL/DS application can access data in the
Teradata RDBMS, both Version 1 and Version 2, with no or minor application
modification.
Benefits of TS/API
TS/API allows you to take advantage of the tremendous storage capability and
processing power of the Teradata RDBMS and the NCR hardware platform
while using the features of the SAS System, QMF, REXX, NATURAL, or other
ISV product. You do not need to change your databases or the programs
already in place that access them. TS/API provides ease of use coupled with
the ability to fully exploit the advantages of the Teradata RDBMS. TS/API also
supports Teradata SQL Extensions with applications that have a pass-through
facility.
Caution: While it is possible that other DB2-based and SQL/DS-based program products
or user-written DB2 and SQL/DS application programs can access the Teradata
RDBMS through TS/API, Teradatas support for these products is limited at
this time. Using TS/API with any software other than the products listed in this
guide is at the users own risk.
Kanji Support
TS/API supports the following features of Kanji/Multi-byte Character Sets
(MBCS):
Character sets:
EBCDIC
KATAKANAEBCDIC
KANJIEBCDIC5026_0I
KANJIEBCDIC5035_0I
Mixed MBCS/Single-byte Character Sets (SBCS) character strings as object
names and literals.
Hexadecimal notation for object names.
GRAPHIC data types.
Note that all SQL keywords and TS/API directives must be coded in SBCS of
the servers corresponding charset.
Prerequisite Knowledge
This book assumes that you are acquainted with the use of QMF,
REXX/RXSQL, NATURAL, and/or the SAS System. For more information on
the Teradata RDBMS, refer to one of the following manuals:
For an NCR System 3600 running Teradata RDBMS Version 1, Release 5.1:
the Teradata RDBMS Concepts and Facilities Manual
For an NCR DBC/1012 running Teradata RDBMS Version 1, Release 5.1: the
Teradata RDBMS Concepts and Facilities Manual
For either platform running Teradata RDBMS Version 1, Release 5.2 and
beyond: the Teradata RDBMS Overview Manual
For a UNIX platform running Teradata RDBMS Version 2, Release 2.0 and
beyond: Introduction to the Teradata RDBMS
For a UNIX platform running Teradata RDBMS Version 2, Release 3: see
Teradata RDBMS for UNIX Release Summary for Version 2 Release 3.0. Search
for additional Version 2, Release 3, manuals at
http://www.info.teradata.com/.
TS/API Usability
This section explains how TS/API functions and the advantages of using
TS/API.
Application
Tool
TS/API's
DSNALI
TS/API
Teradata
DBS
JH01A003
Application
Tool
TS/API's
DSNALI
SSID=
TDxx
Yes No
TIMBALI
TS/API
(IBM's DSNALI)
Teradata
DB2
DBS
JH01A005
The following diagram shows the relationship between application tools and
TS/API.
Application
Tool
Resource
Manager
TS/API
Teradata
DBS
JH01A004
Supported Environments
The following environments are supported by TS/API:
MVS/XA (TSO)
MVS/ESA (TSO)
MVS/XA (CICS)
MVS ESA (CICS)
VM/CMS (SP, HPO, XA in 370 and XA modes, and ESA in 370 and ESA
modes)
Products that run in the CICS environment use the two-phase commit facility
(2PC), which allows CICS (the transaction manager) to synchronize updates on
different resources (databases, file systems, etc.) For additional details on the
2PC facility, see Teradata RDBMS CICS Interface.
This section provides brief descriptions of the products that TS/API has been
certified to support. In addition, it provides procedures for accessing the
Teradata DBMS with these certified products.
Certified Products
TS/API Release 3.3.0 has been certified to support:
Query Management Facility (QMF)
Version 2, Release 4 (MVS/TSO, VM/CMS)
Version 3, Release 1.0 (MVS/TSO, MVS/CICS, VM/CMS)
Version 3, Release 1.1 (MVS/TSO, MVS/CICS VM/CMS)
Version 3, Release 2 (MVS/TSO, MVS/CICS, VM/CMS)
Version 3, Release 3 (MVS/TSO, VM/CMS)
The SAS System (Version 6.07, Version 6.08 and Version 6.09)
SAS/ACCESS Interface to DB2 (MVS/TSO)
SAS/ACCESS Interface to SQL/DS (VM/CMS)
NATURAL, Release 2.2.5 (MVS/TSO and MVS/CICS)
RXSQL, Release 3.4.0 (VM/CMS)
To certify TS/API with an Independent Software Vendor (ISV) product,
Teradata performs extensive testing and quality assurance to ensure that
TS/API works properly with the ISV product, except as specifically noted in
this guide.
Once Teradata certifies a product, it provides technical support, problem
resolution, and software maintenance for TS/API as used with certified
products.
This section describes how TS/API is used with these ISV products.
Note: User familiarity with the supported ISV products is assumed. For
detailed information about the operations of the ISV products mentioned in
this guide, see the appropriate vendor documentation.
To ensure connection to a Teradata DBMS from your ISV products (QMF, SAS
or NATURAL), verify the following before starting the product:
Step Action
IF... THEN...
your installation does not provide you must build and allocate the
a logon exit DBCLOGON data set. See Chapter
3: Session Management for
details.
IF... THEN...
The following are two examples illustrating JCL statements used to invoke
QMF 3.1 and SAS to access TDP0:
QMF invocation:
...
//SYSTSIN DD *
PROFILE PREFIX(USERID)
ISPSTART PGM(DSQQMFE) NEWAPPL PARM(M=B,P=QMF310,S=TDP0)
/*
...
SAS invocation:
...
//SYSTSIN DD *
PROC DBLOAD DBMS=DB2;
SSID=TDP0;
SQL COMMIT WORK;
/*
...
Under MVS/CICS
Verify the following:
Step Action
1. TS/API libraries are properly included in the DFHRPL libraries list in CICS
start-up JCL. The TS/API load libraries should be concatenated before the
DB2 load library, if any.
Under VM/CMS:
Step Action
IF... THEN...
your installation does not provide you must build and allocate the
a logon exit DBCLOGON file. See Chapter 3:
Session Management for details.
3. TS/APIs SQLINIT with the appropriate TDxx was executed. See Chapter 3:
Session Management for details.
A tool that has become preeminent in todays DB2 and SQL/DS environment is
IBMs Query Management Facility (QMF). QMF has emerged as the de facto
product used to access relational data in order to produce reports, graphs, and
charts, either through native SQL commands, prompted queries, or queries by
example. Through TS/API, QMF can be used to access information stored in
Teradata RDBMS databases. The following table shows some QMF issues.
QMF Issues
Step Action
2 TS/API supports QMF 3.2.0, which displays the dates on which each QMF
object was created, modified and last used. Please note that on VM
platforms, only date last used is supported. All three dates are supported
on MVS/TSO and MVS/CICS.
3 3. TS/API supports the QMF Edit Table Facility (ETF) in both edit and browse
mode. TS/API recognizes when a non-updatable table or view is being
accessed with ETF, and automatically places ETF in browse mode. This
allows you to view data but not to update or delete it.
For more information on updatable cursors, see Chapter 7: Command
Syntax.
Step Action
4 TS/API does not support the SAVE=IMMEDIATE option under the QMF
ETF because Teradata SQL does not support the WITH HOLD option of the
DECLARE CURSOR statement. TS/API performs a commit with each SAVE
and then performs clean up for the given ETF session, thereby removing the
cursor.
Removal of the cursor means that you cannot fetch the next row; therefore,
the query must be reexecuted to bring the result table back into memory.
Figure 1-4 on page 1-15 shows the ETF screen on which you enter the SAVE
command.
The two options of SAVE are IMMEDIATE and END. QMF issues the
message shown at the bottom of the screen when you attempt to use
SAVE=IMMEDIATE under TS/API.
5 In the CICS environment, QMF has additional issues and restrictions, which
are:
ROLLBACK is not supported for Data Definition Language (DDL)
statements, since TS/API executes all DDL statements in a one-phase
commit (1PC) session as stand-alone transactions. This means that once a
DDL statement is successfully executed, it cannot be rolled back. For
example, after you issue a DROP TABLE statement, a QMF prompt panel
will request confirmation. Even if you want to undo the DROP TABLE
command, you cant because the table will have already been dropped
and the statement committed. Be aware of this limitation and use the
DROP TABLE/ERASE TABLE statements--and any other DDL
statements--with caution.
QMF Edit Table Facility: There are some problems in TS/API when using
the QMF Edit Table Facility. The problems involve:
Adding a new row to a table (MODE=ADD)
Updating the index values of an existing row (MODE=CHANGE), for
which QMF internally INSERTs a row with a new index value.
These problems occur only when the QMF user attempts to insert a row with
a duplicate index value into a table. Use the QMF SQL Query facility instead
of the Edit Table Facility for INSERTing new rows into tables.
Currently the QMF Erase Table command does not work from the QMF
tables or QMF objects lists. Use the Drop Table SQL statement or QMF
Erase Table command from the QMF command line instead
6 Due to QMF's and DB2s limitations, the 64K DBS feature cannot be used
with TS/API.
Name ( Q.STAFF
Enter the name of the table in the database you
want to edit.
Mode ( CHANGE )
Enter ADD to add new rows, or CHANGE to update
or delete rows.
SAVE ( IMMEDIATE )
Enter IMMEDIATE to save database alterations as
they are made, or END to hold database alterations
until the session is completed.
Confirm ( YES )
Enter NO to turn off confirmation prompting.
Enter YES to accept default confirmation prompting.
Another tool that has become preeminent in todays DB2 and SQL/DS
environment is the SAS System from SAS Institute, Inc. The SAS System is
installed at over 8,000 mainframe sites worldwide.
It has evolved from a data analysis tool to an enterprise-wide information
delivery system. The SAS System accesses a number of different database
management systems (DBMS), among them, DB2 and SQL/DS.
SAS Features
SAS features include:
Data entry, retrieval, and management
Report writing and graphics
Application development
Business planning, forecasting, and decision support
Operations research and project management
Statistical and mathematical analysis (including quality control)
Computer performance evaluation
Executive Information System
Through TS/API, the SAS System can be used to access information stored in a
Teradata RDBMS database. Specify DB2 as the DBMS on the SAS/Access panel
in order to make a Teradata RDBMS or DB2 connection. A DBMS of DBC or
DBC/1012 returns an undefined DBMS access message from the SAS System.
The specified SSID then indicates which will be accessed: the Teradata RDBMS
or DB2.
SAS Issues
Be aware of the following issues before using either the SAS/ACCESS interface
to DB2 or the SAS/ACCESS interface to SQL/DS.
SAS/ACCESS provides a Proc SQL passthrough facility, which allows SQL
statements to be passed to DBMS without being parsed by SAS. This facility
alleviates the problems listed in the following table.
Step Action
1 You can use the SAS System view descriptor (without performance degradation) anywhere it is legal to
use a SAS data file, with the exception of PROC SQL, the FSEDIT window, and PROC DBLOAD.
The PROC SQL SELECT statement generates inefficient SQL in some cases.
Performance is not affected using the PROC SQL SELECT statement if you issue a SELECT * FROM <
descriptor> ... statement or specifically select view descriptor columns (e.g., SELECT col1, col2, ...).
The SAS System retrieves all rows to the client as defined by the original view descriptor definition.
However, performance degradation occurs using the PROC SQL SELECT statement if you issue a
SELECT COUNT(*)... statement or a SELECT ... ORDER BY ... statement. The SAS System retrieves
all rows to the client as defined by the original view descriptor definition into temporary storage. For
the SELECT COUNT(*) request, the SAS System calculates the COUNT (reads and counts all the
retrieved records) instead of using the more efficient COUNT function on the Teradata RDBMS. For
the SELECT ... ORDER BY ... request, SAS sorts the retrieved records itself instead of allowing the
Teradata RDBMS to perform the ORDER BY clause more quickly and without using client resources.
The performance of these queries ranges from slow to extremely slow because the client and DBMS
must engage in a duplication of effort.
A view descriptor used as input to PROC DBLOAD generates inefficient SQL because the SAS System
retrieves each row to the client (translating between DBMS data types and SAS data types) and then
builds an insert for each row retrieved, sending it back to the Teradata RDBMS. Therefore, if a large
amount of data is to be loaded on to the Teradata RDBMS, use one of Teradata RDBMS load utilities.
2 PROC DBLOADs native SQL screen is best used for most statements that do not return data.
Data-returning statement cannot be used with the native SQL screen, including:
SELECT
SHOW
HELP
EXPLAIN
COMMENT (data-returning form)
EXEC (data-returning form)
Step Action
You can use the SAS Query Entry Window to execute native SQL to copy from a SAS System view
descriptor to a Teradata RDBMS table. To create the table, issue a CREATE TABLE or CT with the
appropriate parameters. To populate the table, issue:
INSERT INTO <table1> SELECT * FROM <table2>
where <table2> underlies the SAS view descriptor.
3 Batch considerations:
No special batch considerations exist for improving SAS performance with the DBMS other than those
presented above.
Submit queries in batch when you expect slow performance (see View Descriptor usage above),
thereby freeing your session while your job executes.
4 Running under MVS, SAS/ACCESS returns an SQLCODE of 100 (ROW NOT FOUND FOR FETCH)
when a user requests access to a Teradata DBS view that contains more than 50 columns. This halts SAS
execution.
In order to satisfy a user request to access a Teradata DBS view, SAS/ACCESS queries DB2 catalog table
SYSIBM.SYSCOLUMNS to gather user view column information. TS/API uses Teradata DBS emulation
view SYSIBM.SYSCOLUMNS in order to select data from the appropriate Teradata DBS catalog tables in a
format that matches the format used in the DB2 catalog table.
However, since the Teradata DBS pre-V2R2 software does not maintain view column data in its catalog for
views with more than 50 columns, the query that SAS/ACCESS issues against table
SYSIBM.SYSCOLUMNS to retrieve user view column information returns an SQLCODE of 100,
indicating that the row was not found.
Note: with Teradata RDBMS V2R2, and above, of there is no limit to the number of columns allowed.
5 SAS does not allow multi-statement requests. When using SAS under either MVS or VM, if you have an
extended IBM keyboard, you can use the } symbol to denote an end-of-statement delimiter. TS/API
translates the } symbol to a semicolon ; prior to sending the multi-statement request to the Teradata
RDBMS.
6 The logon statement issued from the command line of SAS is meaningless because the SAS System
establishes a Teradata RDBMS connection for each statement, executes the statement (in this case the
LOGON), and terminates the connection.
7 TS/API supports the SAS FSVIEW, FSBROWSE procedure as well as the browse mode of SAS FSVIEW.
Use the browse capability when you are accessing a table or view that is not updatable.
NATURAL
NATURAL Issues
Step Action
2 On the NATURAL Interactive SQL for DB2 screen, free form Teradata RDBMS
SQL may be executed. It must be noted, however, that NATURAL parses the
SQL, and assumes the end of input when it encounters a semicolon.
Therefore, a user who is executing a multi-statement request, a CREATE
MACRO statement, or other statement which includes more than one
semicolon must use the TS/API alternate delimiter of } in place of
semicolons, up to the last semicolon in the statement. Otherwise NATURALs
parser, upon encountering the first of several semicolons in the SQL
statement(s), will assume end of input and will truncate the rest of the SQL
input. TS/API will automatically translate all } symbols to semicolons prior
to sending the statement(s) to the Teradata RDBMS.
RXSQL
RXSQL Issues
The following table shows some RXSQL issues.
Step Action
1 RXSQL supports the use of both Dynamic and Extended Dynamic SQL
statements. Since Teradata RDBMS does not support the Extended Dynamic
SQL, TS/API has to emulate it. Instead of creating a package, TS/API creates
a macro with the same name, plus the section number. For example, if RXSQL
issues an Extended Dynamic PREPARE for a SELECTstatement which is to be
stored in section 1 of package SQLPKG, and the second Extended Dynamic
PREPARE for an UPDATE statement for section 2 on the same package,
TS/API will create two macros named SKLPKG_1 and SQLPKG_2. The first
macro will contain the SELECT atatement and the second will contain the
UPDATE statement.
During the execution of the Extended Dynamic SQL, TS/API will find the
appropriate macro and execute it. This process emulates the Extended
Dynamic SQL with the following limitations:
Positional UPDATE and DELETE cannot be executed with the Extended
Dynamic SQL. This is because TS/APIs updatable cursor feature does
not support Extended Dynamic SQL.
The DROP PACKAGE and DROP STATEMENT commands are ignored
by TS/API since no packages exist on the Teradata RDBMS. There is no
need to drop the macros, since TS/API always executes REPLACE
MACRO command. Therefore, the old macros are replaced.
2 Before running RXSQL with TS/API in VM/CMS, always set the following
VM/CMS system option:
SET STORCLR ENDCMD
See Chapter 2: TS/API Installation and Customization for additional
details.
For MVS/TSO DB2 applications, the DB2 Trace Facility is used to collect
information about the behavior of a DB2 application when it is used with DB2
itself. After collecting trace information and determining the behavior of a DB2
application when it is used with DB2, you can compare to it the behavior of the
DB2 application when it is used with TS/API.
Use the DB2 Trace Facility in the following cases:
You encounter a problem with DB2 application used with TS/API.
You attempt to use an uncertified DB2 application with TS/API.
Note: The MVS and VM installation sections of the previous Teradata TS/API
Installation Guide are now located in the Teradata Client for MVS Installation
Guide, and the Teradata Client for VM Installation Guide, respectively.
This section describes how TS/API interacts with application tools under TSO
and in batch.
Step Action
2 Modify the JCL to meet your installation requirements, including the JOB
statement information and high-level qualifiers.
When vectoring is enabled, TS/API directs all SQL requests to either the
Teradata RDBMS or DB2, depending upon the subsystem ID that the
application supplies at runtime:
Application
Tool
TS/API's
DSNALI
SSID= No
TDxx
Yes
DB2's
TS/API DSNALI
(Linked as TIBMALI)
Teradata
DB2
DBS
JH01A001
TSO
Application
Tool
TS/API's
DSNALI
SSID= No
TDxx
Yes
TS/API's
TS/API
TIMBALI
DB2
error code
Teradata
DBS
JH01A002
If... Then...
In the CICS environment, application tools (for example, QMF and NATURAL)
use DB2s CICS Attach Facility module (DSNCLI) to access DB2. TS/API
replaces that module with its own DSNCLI, which routes all requests to
TS/API.
Figure 2-3 depicts the control flow.
CICS Application
Tool
TS/API's
DSNALI
TS/API
Teradata
DBS
JH01A003
Note: TS/API 3.1 does not support vectoring to DB2 under CICS.
CICS must be able to access APILOAD and the CLIv2 CICS load library
(CXILOAD) in order to run transactions using TS/API. Therefore, concatenate
these libraries to the DFHRPL list. The APILOAD library should be placed
ahead of the DB2 load library (if any).
Note: For details on how to customize your CICS, see Teradata Client for MVS
Installation Guide and Teradata Client for VM Installation Guide.
Further Instructions
For instructions on allocating the DBCLOGON file see Chapter 3: Session
Management.
After completing the TS/API installation, for instructions on how to set up the
Teradata RDBMS to enable the TS/API functions see Setting Up the Teradata
RDBMS for TS/API on page 2-8, and Installing ISV Products on page 2-11.
This section describes the creation and initialization of the Teradata RDBMS
databases, tables, and views used by TS/API. Familiarity with BTEQ is
required. For detailed information on BTEQ, see Teradata BTEQ Reference.
BTEQ Scripts
The BTEQ scripts are supplied with a filetype of DBCSQL for VM, and are
included in <dbcPfx>.CLIST for MVS. Running these scripts requires full
Teradata RDBMS authority. Userid DBC or SYSADMIN is recommended
because these userids have Teradata RDBMS system authority. The BTEQ
scripts are subject to change depending on the release level of TS/API, and re-
installation may be required with new TS/API releases.
If... Then...
you have more than one Teradata you must run these scripts on each Teradata
RDBMS RDBMS that is used with TS/API.
you have already run these scripts you do not need to repeat the process on VM
from MVS and vice versa. The contents of these scripts are
identical in both VM and MVS.
TS/API Databases
If you are installing TS/API for the first time, you must run BTEQ with the
following scripts in the order shown. Run these scripts under the Teradata
RDBMS userid DBC or SYSADMIN:
SYSDBSCreates TS/API databases SYSAPI, SYSIBM, SYSTEM, SQLDBA.
If the SYSADMIN database does not have sufficient space, change the line
in the SYSDBS BTEQ script that modifies the SYSADMIN PERMSPACE
value. Enter the correct amount of PERMSPACE and remove the comment
indicator before running the script.
SYSAPICreates TS/API system tables.
Note: SYSIBM and SYSTEM do not have DROP TABLE statements. Therefore,
these scripts will result in non-0 return codes because the CREATE TABLE will
fail (the tables already exist).
Open Support
The TS/API 3.3.0 release provides an open support of DB2 and SQL/DS
applications in MVS/TSO, in batch, MVS/CICS, and VM/CMS environments.
JCL Example
The following JCL example shows how to execute the TERABIND utility:
// JOBCARD
//*
//* BUILD TS/API EMULATION MACROS FROM TWO SAS DBRMS
//*
//*
//S1 EXEC PGM=IEFBR14
//DDI DD DSN=<userid>.SASMACRO.BTEQ,
// UNIT=SYSDA,SPACE=(TRK,0),
// DISP=(MOD,DELETE,DELETE)
//*
//S2 EXEC PGM=TERABIND,PARM='<dbname>.<planname>'
//STEPLIB DD DSN=<dbfpfx>.APILOAD,DISP=SHR
//INDBRM DD DSN=SAS0608.DBRM(SASDB2E),DISP=SHR
// DD DSN=SAS0608.DBRM(SASDB2L),DISP=SHR
//OUTBTEQ DD DSN=<userid>.SASMACRO.BTEQ,UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=80),
// SPACE=(TRK,(1,1),RLSE),DISP=(,CATLG,CATLG)
//SYSPRINT DD SYSOUT=*,
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118)
//SYSUDUMP DD SYSOUT=*,
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118)
//*
//S3 EXEC PGM=IEBGENER,COND=EVEN
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=<userid>.SASMACRO.BTEQ,DISP=SHR
//SYSUT1 DD SYSOUT=*
//SYSIN DD DUMMY
//
Usage Notes
DBRMs
DBRMs produced by DB2 V2R3 and below are supported.
DB2 Parser
The DB2 parser does not support DB2 special registers in SELECT statements
without a FROM or INTO clause. Consequently, some static SQL SELECT
statements are coded inefficiently with an unnecessary FROM clause.
An example from a QMF DBRM follows:
SELECT USER FROM SYSIBM.SYSTABAUTH
This statement returns the USER for each row in table SYSIBM.SYSTABAUTH.
Since TERABIND converts such a statement directly from a DB2 DBRM
statement into a Teradata RDBMS macro, with the FROM clause intact, you
may remove unneeded FROM clauses from such statements.
SQL
TERABIND produces SQL that sometimes is not Teradata RDBMS SQL-
compatible. For instance, if CURRENT SERVER is in a SELECT statement, the
Teradata RDBMS returns a syntax error.
Edit the TERABIND output for such problems and map the SQL syntax to
comply with Teradata RDBMS SQL. See Chapter 7: Command Syntax for
details.
User-specified Parameters
TERABIND accepts two user-specified parameters.
Provide the required input parameter of <DBNAME>.<PLANNAME>. You
may optionally specify a second keyword input parameter of DEBUG as well.
Use of the DEBUG parameter causes TERABIND to produce diagnostic
information during the translation of SQL statements to CREATE MACRO
statements. Both input parameters are nonpositional and case insensitive. For
example, all of the following combinations of input parameters are valid:
PARM=DEBUG Q.QMF310
PARM=Q.QMF310 DEBUG
PARM=Q.QMF310
PARM=DeBUG q.Qmf310
Record Format
TERABIND checks the format of records in DBRM and terminates if an invalid
DBRM record is encountered. For example, TERABIND verifies that the string
"DBRM" appears as the first four characters of the first record of the DBRM and
validates the legality of the DBRM name extracted from columns 17 through 25
of the first record.
The following sections describes the instructions to install each of the certified
supported products listed in the beginning of this chapter.
QMF
QMF does not need to be linked-edited with DSNALI or DSNCLI, and Teradata
provides all necessary BTEQ scripts on the installation tape, so the only
required step for QMF is to set up the Teradata RDBMS using these scripts.
Running the BTEQ scripts accomplishes the following:
Creates Q database on the Teradata RDBMS.
Creates QMF tables, views, and macros in the Q database.
Inserts the QMF plan name into the SYSIBM.SYSPLAN table (MVS only),
and INSERTs appropriate cursor names into SYSIBM.SYSCURS.
Grants the appropriate authority to the above objects.
Note: Run BTEQ scripts to setup TS/API, first. Run the QMF BTEQ scripts
after installing the SYSIBM and/or SYSTEM BTEQ scripts.
Before running the BTEQ scripts, you must provide the installation-specific
information in JCL (for MVS) or in an EXEC (for VM).
On MVS, the scripts are found in the <dbcPfx>.CLIST control library, and the
BTEQ sample job is in the <dbcPfx>.SAMPLIB. On VM, the scripts are found
on the client utilities installation disk.
IF... THEN...
you are installing QMF you must run the following scripts in the given order:
for TS/API QOBJNEWDefines Q database and QMF system
tables.
QReplaces QMF system views and macros.
Q.COMMAND_SYNONYMS
Q.DSQ_RESERVED
Q.ERROR_LOG
Q.OBJECT_DATA
Q.OBJECT_DIRECTORY
Q.OBJECT_REMARKS
Q.PROFILES
Q.RESOURCE_TABLE
The QOBJNEW and Q BTEQ scripts then rebuild the QMF object tables,
destroying any data contained in them.
Note: If you do not back up these tables, you may lose all QMF stored objects.
Sample Tables
Q.APPLICANT
Q.INTERVIEW
Q.ORG
Q.PARTS
Q.PRODUCTS
Q.PROJECT
Q.SALES
Q.STAFF
Q.SUPPLIER
System Tables
Q.COMM_SYNS_CICS_E
Q.COMM_SYNS_CMS_E
Q.COMM_SYNS_TSO_E
Q.DSQ_RESERVED
Q.DSQEC_ALIASES
Q.DSQEC_COLS_LDB2
Q.DSQEC_COLS_RDB2
Q.DSQEC_COLS_SQL
Q.DSQEC_QMFOBJS
Q.DSQEC_TABS_LDB2
Q.DSQEC_TABS_RDB2
Q.DSQEC_TABS_SQL
Q.DSQIOLST_AI_VIEW
Q.DSQIOLST_AU_VIEW
Q.DSQIOLST_QT_VIEW
Q.DSQIOLST_TB_VIEW
Q.COMM_SYNS_CICS_E
Q.COMM_SYNS_CMS_E
Q.COMM_SYNS_TSO_E
Q.DSQ_RESERVED
Q.DSQEC_ALIASES
Q.DSQEC_COLS_LDB2
Sample Tables
Q.APPLICANT
Q.INTERVIEW
Q.ORG
Q.PARTS
Q.PRODUCTS
Q.PROJECTS
Q.SALES
Q.STAFF
Q.SUPPLIER
QKANJI Tables/Views
If QKANJI is run, the following tables/views should also appear:
System Tables
Q.COMM_SYNS_CICS_K
Q.COMM_SYNS_CMS_K
Q.COMM_SYNS_TSO_K
Sample Tables
Q.APPLICANTK
Q.INTERVIEWK
Q.ORGK
Q.PARTSK
Q.PRODUCTSK
Q.PROJECTSK
Q.SALESK
Q.STAFFK
Q.SUPPLIER
These views and tables are compatible with those supplied on the IBM QMF
installation tape. For a description of these views and tables, see the IBM QMF
Reference Manual.
SAS
NATURAL
IF... THEN...
you have a DB2 license use DB2s version of DSNTIAR module in these link-edit
jobs so you can get full error messages formatting.
Teradata provides the necessary BTEQ scripts on the TS/API installation tape.
These scripts are included in the SYSIBM DBCSQL script and accomplish the
following:
Register the NATURAL plan name in the SYSIBM.SYSPLAN table
Define cursors to TS/API
RXSQL
Session Management
The Teradata RDBMS connects to a client through the TDP, which is identified
by its tdpid. If more than one Teradata RDBMS is connected to a client, there
may be several tdpids you can use.
An MVS tdpid can take the form:
TDxy
where x is one of the following letters:
P
Q
R
S
and y is any single digit or uppercase letter.
A VM tdpid takes the form:
TDxy
where x and y are any single digits or uppercase letters.
In all the supported environments, you can specify the desired tdpid in the
DBCLOGON file/table, as part of your LOGON string (see later in this
chapter). In addition, under MVS/TSO, in batch, and under VM/CMS, you
may omit the tdpid portion of the LOGON string and specify the tdpid as
described below:
Under VM/CMS
Before any program that uses SQL/DS is invoked the SQLINIT EXEC should
be executed, which sets up a default database for the user (DBNAME
parameter). Executing SQLINIT creates an ARISRMBT MODULE, containing
the default database name, on the users A-disk. TS/API gets the database
name from that module and uses it as a tdpid to be accessed, unless it is
overridden by a tdpid provided in the LOGON string. The following is an
example of using the SQLINIT EXEC to specify TDP0 as the tdpid:
EXEC SQLINIT DBNAME(TDP0)
To switch tdpids or to switch back to SQL/DS, re-execute SQLINIT with the
proper value of the DBNAME parameter.
In order to log on to the Teradata RDBMS, two other values are required
besides the tdpid:
The Teradata RDBMS userid
The password associated with the Teradata RDBMS userid
These logon parameters can be specified in one of two ways:
Through a DBCLOGON file/table
Through a TDP logon exit
Note: The semicolon at the end of the LOGON command is optional. If the
tdpid is specified, it overrides the value of the tdpid passed to TS/API by other
means. On VM, if the first command from the application is an explicit
CONNECT or LOGON, the logon information is built from that command,
rather than from the DBCLOGON file.
DBCLOGON must be allocated before you use any program that invokes
TS/API. If it is not allocated or if it does not contain a LOGON command,
TS/API performs an implicit logon to the Teradata RDBMS. The TDP passes an
implicit logon request to the logon exit if one is installed (see details later in this
chapter).
Under CICS
TS/API uses the following tables in CICS to obtain logon information for a
transaction:
BBIRCT (Resource Control Table in CICS)
Each entry in BBIRCT contains one or more transaction ids and the
corresponding plan name. It also specifies what name associated with a
CICS transaction TS/API should use to look up the DBCLOGON table in
CICS for that transactions logon information. Each transaction that uses
TS/API must be defined in the BBIRCT table in CICS.
DBCLOGON
Each entry in the DBCLOGON table in CICS contains a key field, which is
used during the search, and an information field that contains TS/API
directives, including a LOGON command.
BBIRCT Macro
Use the following statements to build the BBIRCT table in CICS:
BBIRCT TYPE=INITIAL
BBIRCT TYPE=ENTRY,
TXID=(<txid1>,<txid2>,<txid3>, ...),
PLAN=<plan_name>,
AUTH=(<auth_type_list>)
BBIRCT TYPE=ENTRY
TXID=(<txid1>, <txid2>, <txid3>, ...),
PLAN=<plan_name>,
AUTH=(<auth_type_lists)
...
BBIRCT TYPE=FINAL
DBCLOGON Macro
Use the following statements to build the DBCLOGON table in CICS:
DBCLOGON TYPE=INITIAL
DBCLOGON TYPE=ENTRY,
AUTHKEY=<auth_key>,
LSTRING=<DBC_logon_string>
DBCLOGON TYPE=ENTRY,
AUTHKEY=<auth_key>,
LSTRING=<DBC_logon_string>
...
DBCLOGON TYPE=FINAL
authorizes access to the Teradata TS/API is connected under the userid supplied
RDBMS by the logon exit.
Product Management
TS/API supports QMF, SAS, and NATURAL under MVS/TSO and in the batch
environment.
To ensure connection to the Teradata RDBMS instead of to DB2, verify the
following:
Step Action
2 Your DBCLOGON file, or TDP logon exit, is properly prepared (see the
previous chapter for details).
A proper tdpid in form of TDxx is specified as a subsystem name when
invoking the product. If you specify a tdpid in your DBCLOGON file, it
overrides the value specified by other means.
However, in the MVS/TSO and batch environments, the subsystem name is
used by the TS/API Call Attach Facility to route the requests either to DB2
or to TS/API. (See Chapter 2: TS/API Installation and Customization for
more information about vectoring.) Therefore, even if you have a tdpid in
the LOGON string, the subsystem name still must start with TD to ensure
vectoring the requests to TS/API rather than to DB2.
The following are examples of JCL statements used to invoke QMF and
SAS with a tdpid equal to TDP0:
//SYSTSIN DD *
PROFILE PREFIX(<userid>)
ISPSTART PGM(DSQQMFE) NEWAPPL PARM(M=B,P=QMF310,S=TDP0)
/*
//SYSTSIN DD *
PROC DBLOAD DBMS=DB2;
SSID=TDP0;
SQL COMMIT WORK;
RUN;
/*
Note: For SAS invocation, you must specify DB2 as the DBMS in order to make
a Teradata RDBMS or DB2 connection. With any other value, SAS returns an
undefined DBMS access message. The specified SSID then controls vectoring to
the Teradata RDBMS or DB2.
VM Products
Step Action
MVS/CICS Products
Step Action
2 The BBIRCT and DBCLOGON tables in CICS or the logon exit are properly
prepared (see the previous chapter).
Problem Management
DEBUG OFF The default. No trace output is generated. You can also use DEBUG
OFF to stop tracing when DEBUG ON or DEBUG SQL is in effect.
DEBUG SQL All SQL statements sent to the Teradata RDBMS are printed. This
command lets you view how TS/API converts DB2 or SQL/DS
SQL into Teradata SQL.
DEBUG ON TS/API routine names are printed on entry and exit, along with the
contents of all relevant data structures. DEBUG ON generates a
large volume of information and is used mainly to trace serious
system problems. Usually, you would send this information to the
Global Support Center (GSC) for problem resolution.
DEBUG Directive
You can issue the DEBUG directive as a standard SQL request (for instance,
from the QUERY PANEL of QMF). This method is particularly useful when you
want to see how TS/API translates your SQL before sending it to the Teradata
RDBMS.
You can also place the DEBUG directive in the DBCLOGON file/table on a
separate line. That way, you can trace TS/API activity even before a connection
is made with the Teradata RDBMS. This is useful in diagnosing errors that
occur in trying to start a program product.
When TS/API receives the DEBUG directive, its internal tracing mechanism is
activated. If the directive was sent from a program product, TS/API returns an
SQLCODE of zero, even though no actual Teradata RDBMS request was
performed.
TS/API also provides a DB2 trace facility under both MVS/TSO and batch, if
you have DB2 installed and vectoring enabled (see Chapter 2: TS/API
Installation and Customization). The DB2 trace facility pinpoints problems
with a DB2 application used with TS/API.
The trace provides DB2 session information when the application is used with
DB2. After determining how a DB2 application behaves when used with DB2, a
user can compare that to how the DB2 application behaves when used with
TS/API. Determining the differences in behavior, and where these differences
occur, is useful in debugging problems that a DB2 application might have when
used with TS/API.
Note that DB2 call information is traced both for the application passing
information to DB2 to make a request and for DB2 passing requested
information and call status back to the application.
In MVS, debug output is written to the DDNAME OUTPUT, and DB2 trace
output is written to the DDNAME TRACE.
is not explicitly allocated a data set named that data set is used.
userid.TSAPI.DEBUG exists
Allocating OUTPUT
When allocating the OUTPUT file, a DDNAME of OUTPUT must be used. For
example, in TSO:
ALLOCATE DD(OUTPUT) SYSOUT(A) RECFM(VBA) LRECL(85) BLKSIZE(6124)
or in batch:
//OUTPUT DD SYSOUT=A,DCB=(RECFM=VBA,LRECL=85,BLKSIZE=6124)
Allocating TRACE
When allocating the TRACE file, a DDNAME of TRACE must be used. For
example, in TSO:
ALLOCATE DD(TRACE) SYSOUT(A) RECFM(VBA) LRECL(85) BLKSIZE(6124)
or in batch:
//TRACE DD SYSOUT=A,DCB=(RECFM=VBA,LRECL=85,BLKSIZE=6124)
Caution: Use a file disposition of MOD when allocating the OUTPUT and TRACE data
sets. If you dont use MOD, only the last cycle of TS/API debug or DB2 trace
output is saved in the file.
IF OUTPUT... THEN...
is not explicitly allocated a file named TSAPI DEBUG is written on the users A-
disk.
When DEBUG ON is used, a large amount of output is written to the debug file.
Make sure you have sufficient disk space available before using this option.
Each user must have his own OUTPUT file, which has a record format of VBA,
a record length of 85, and a block size of 6124.
When allocating the OUTPUT file, a DDNAME of OUTPUT must be used, for
example:
FILEDEF OUTPUT DISK fn ft fm (DISP MOD)
Caution: Use a file disposition of MOD when explicitly allocating the OUTPUT file. If
you dont use MOD, only the last cycle of debug output is saved in the file.
Under CICS, TS/API writes debug information to destination name TSDB. All
TS/API CICS users in a given CICS region with the debug turned on will write
to the same destination. Therefore, that destination must be defined to CICS as
an extrapartition transient data queue. See Chapter 2: TS/API Installation and
Customization for details.
That guarantees that each record in the debug output is prefixed with the CICS
terminal ID and the CICS transaction ID, which allows the debug output to be
identified with the transaction that produced it. This identification is very
important if more than one CICS user is creating debug output at the same
time.
Closing the debug file will force any blocks/records buffered in memory to be
written to the data set.
An external job can then be run to copy or print the contents of the OUTPUT
data set. The OUTPUT data set can be viewed via ISPF browse while it is open.
The TSDB data queue must be open while TS/API is writing data to it. If the
queue is closed, TS/API will send the following message to the terminal that
issued the request:
The physical sequential file itself must be allocated in the CICS startup JCL. The
following statement can be used in the CICS startup JCL:
//OUTPUT DD DSN=TSAPI.DEBUG.OUTPUT,DISP=MOD
Caution: Use a file disposition of MOD. Otherwise, only the last cycle of TS/API debug
data will be captured. With MOD, each time data is written to the file, the file is
appended. Consequently, you must initialize the file when it is necessary to
clear out old data.
First Cycle
TS/APIs first cycle is numbered 0. The presence of the first cycle indicates that
the TS/API front-end assembler routines are successfully communicating with
the TS/API C runtime routines.
Other displays in the first cycle indicate the TS/API release level and the event
date and time. Under VM, if TS/API is installed in a DCSS, the word DCSS
immediately follows the release identifier.
If nothing is displayed, one of three possibilities exists:
1 The OUTPUT file allocation is incorrect (or dummied out).
In this case, the application is successfully communicating with the TS/API
runtime routines (via the TS/API front-end), but you would have to prove
it by submitting queries (because the output file is disabled) before exiting
the application and correcting it. For example, issuing the DATABASE
<userid> command would execute successfully on the Teradata RDBMS
but not in DB2 or SQL/DS.
Last Cycles
Logoff information indicating a successful or unsuccessful logoff is displayed.
Unit of Work
QMF, SAS, and NATURAL automatically manage the unit of work for the user.
Typically, the application commits automatically after a single successful query.
TS/APIs transaction management logic automatically emulates that of DB2
and SQL/DS by issuing BT and ET requests where appropriate. Some of these
requests are performed implicitly by TS/API; others are performed by the
applications explicit request.
Typically, QMF, SAS, and NATURAL auto-rollback immediately after a query
that returns a DBMS error.
If you encounter a TS/API error condition that you cannot solve, report the
error to the Global Support Center (GSC). Be sure to include all of the
information in the following table:
# Category Information
Step Action
DEBUG ON;
LOGON [tdpid/]userid,password;
3 Allocate an OUTPUT file to receive the output of the debugging session. See
the beginning of this chapter for more information on the OUTPUT file.
4 Send the OUTPUT file contents to the GSC (in machine-readable form, if
possible).
Error Translations
TS/API translates Teradata RDBMS and CLIv2 error codes into the appropriate
DB2 or SQL/DS SQLCODEs and their corresponding SQLSTATEs.
CLI0286
SQLCODE -8286
Because the Teradata RDBMS and CLIv2 error code range is outside of the
normal DB2 and SQL/DS range of -999 to 999, an untranslated error code
usually results in fatal termination of the application or program.
Appendix A: Translation Tables contains translation tables between DB2 and
SQL/DS SQLCODEs and Teradata SQL error codes.
This chapter describes how TS/API supports static SQL statements embedded
in DB2 or SQL/DS applications and how TS/API emulates the system catalog
tables of DB2 and SQL/DS.
This chapter contains the following information:
Static SQL Support
System Catalog Support
Step Action
2 The DB2 precompiler changes any static SQL statements embedded in the
program into comments and replaces them with valid host language
statements.
3 The DB2 precompiler validates SQL syntax and checks the definitions of the
host language variables.
4 The DB2 precompiler generates a data set called a database request module
(DBRM). DBRMs are used as input to the application program binding
process. A DBRM contains the following:
The embedded SQL statements extracted from the source program
The host variable information extracted from the source program
Information that ties the DBRM to the source statements
5 The precompiler also generates the expanded host language program, which
references the DBRM and is used as input to the compiler. Resulting object
code is input to the linkage editor, which produces one or more executable
load modules.
6 The DBRMs and the load modules are made available to the customer.
Step Action
1 Checking syntax
During the execution, DB2 uses the plan to execute the static SQL statements.
Figure 6-1 Preparing a DB2 Application with Embedded SQL for Execution
Host Language
DB2 Precompiler
DBRM
(one per source module) Expanded
Host Language
Compile
Object Module
Link Edit
Load Module
Data
Plan Base
JH01A007
Step Action
1 The source code of the program product is fed into the SQL/DS preprocessor
at the vendor site.
2 The SQL/DS preprocessor validates SQL syntax and checks the definitions of
the host language variables.
3 The preprocessor running at the vendor site generates the expanded host
language program, which references the programs corresponding access
module and is used as input to the compiler.
4 Resulting object code is input to the linkage editor, which produces one or
more load modules that are shipped to the customer.
Step Action
1 The ISV product embedded SQL source is fed into the SQL/DS preprocessor at
the customer site.
Figure 6-2 Preparing an SQL/DS Application with Embedded SQL for Execution
SQL/DS
Preprocessor
Expanded
Host Language
Compile
Object Module
Link Edit
Load Module
SQL/DS
Preprocessor
Figure 6-3 DB2 Static SQL Translation to Teradata SQL Macros Process for Certified ISVs
BTEQ
Teradata DBS
Data
Macros
Base
Execution Time
TS/API
Application Execution
Application Load
Module
JH01A009
Figure 6-4 SQL/DS Embedded SQL Translation to Teradata Macros Process for Certified ISVs
BTEQ
Teradata DBS
Data
Macros
Base
Execution Time
TS/API
Application Execution
Application Load
Module
JH01A010
At runtime, TS/API executes the appropriate Teradata SQL macros, using the
macro naming convention as follows:
Database name.Program name_Section number
The SYSAPI database contains one special dummy table that TS/API uses for
null mapping, called SYSAPI.SYSDUMMY.
Caution: Due to internal limitations in many applications, use of Teradata RDBMS object
names longer than those permitted by DB2 or SQL/DS may cause anomalies. If
an application fetches a column name into a client variable that is less than 30
characters, a long Teradata RDBMS object name may be improperly truncated.
If the truncated name is then used as the basis for building further queries,
subsequent syntax errors may occur.
Authorization IDs
The Creator columns in DB2 and SQL/DS catalog tables refer to the
authorization id used by DB2 and SQL/DS. No authorization id for the
Teradata RDBMS exists; the database or userid under which the table or view
was created is used as the closest Teradata RDBMS equivalent to an
authorization id.
This equivalent id is not used to support either the DB2 concept of a database
or table space or the SQL/DS concept of a dbspace.
Since an authorization id is an eight-character DB2 or SQL/DS object and the
Teradata RDBMS database name or userid is up to 31 characters, the limitations
mentioned in the preceding caution apply to these columns also.
Command Syntax
This chapter describes the differences between Teradata SQL and the SQL used
by DB2 and SQL/DS.
TS/API Release 03.04.00 supports the Teradata V1 RDBMS release, as well as
V2R1. V2R2 and V2R3 releases in Teradata mode only.
This chapter contains the following information:
SQL Differences
Transaction Management
Updatable Cursor Support
Syntax Mapping Strategy
Teradata SQL Extensions Differences
DB2 Syntax Mapping
SQL/DS Syntax Mapping
Teradata SQL Extensions
TS/API Directives
SQL Differences
Transaction Management
DB2 or SQL/DS
Under DB2 or SQL/DS, a unit of work is defined as an entity capable of being
committed or rolled back. The first unit of work is the work done from the first
access to a relational database until a COMMIT or ROLLBACK occurs. The next
unit of work is the work done from the next access to the database until the next
COMMIT or ROLLBACK occurs, and so forth. All modifications to the
database are capable of being rolled back until a COMMIT is successfully
executed.
Teradata RDBMS
Within the Teradata RDBMS, a unit of work is defined as an entity that falls
between a BEGIN TRANSACTION (BT) statement and an END
TRANSACTION (ET) statement. If no BT and ET statements are present, the
Teradata RDBMS automatically treats each statement as a unit of work.
To emulate DB2s or SQL/DS behavior, TS/API (under TSO or CMS) issues a
BT prior to sending any request to the Teradata RDBMS if this is the first
request in the session or if the previous request was a COMMIT/ROLLBACK.
In this way, TS/API begins a transaction, which then is ended by an
ET/ROLLBACK statement when the application issues a
COMMIT/ROLLBACK.
Under CICS, however, applications are using EXEC CICS SYNCPOINT
commands instead of COMMIT or ROLLBACK, and CICS performs
transaction management in two-phase commit (2PC) mode. Therefore, under
CICS, TS/API doesnt issue any BT/ET statements; instead, TS/API provides a
syncpoint exit routine through which CICS notifies TS/API of any syncpoints
performed. TS/API does only its own clean-up in response to these
notifications.
The syntax of DB2 and SQL/DS SQL is largely compatible with that of Teradata
SQL. In cases of incompatibility, TS/API ensures logical mapping between DB2
and SQL/DS SQL and Teradata SQL when possible. When a functionally
equivalent Teradata SQL syntax exists, TS/API automatically maps the DB2
and SQL/DS SQL syntax into the corresponding Teradata SQL.
If no equivalent exists, TS/API handles the mapping in one of two ways:
Null mapping
Syntax error
TS/APIs primary goal in handling DB2 and SQL/DS syntax that has no
Teradata SQL equivalent is to eliminate confusion. In cases where a DB2 or
SQL/DS SQL statement performs a function not supported by the Teradata
RDBMS, where no misleading results will occur, and where no Teradata SQL
equivalent exists, TS/API maps the DB2 or SQL/DS statement into a null
statement.
TS/API sends a null statement to the Teradata RDBMS. The statement
accomplishes no work but returns a valid return code. TS/API does not send a
null statement to the Teradata RDBMS in cases where misleading results would
occur. In such cases, TS/API does no mapping and simply returns a syntax
error. Refer to Table 7-3 through Table 7-10 for examples of null mapping and
syntax errors.
The following translation notes define some differences in syntax between
Teradata SQL and DB2 and SQL/DS SQL.
Referential Integrity
The referential integrity syntax of DB2 and SQL/DS is not supported in the
Teradata SQL Version 1 release. When encountered, these constructs generate a
syntax error. However, this syntax is supported in V2R2 Teradata SQL.
Subqueries
The following functions are not supported in Teradata SQL Version 1:
The EXISTS clause
ANY, ALL, and SOME predicates
Correlated subqueries
When they occur, these constructs generate a syntax error. However, they are
supported in V2R2 Teradata SQL.
Type Action
Type Action
The following are those Teradata SQL Extensions that may affect the results
returned to the application.
Sorting Nulls
Teradata SQL sorts nulls after all other data in a column. DB2 and SQL/DS sort
nulls before any other data in a column. This difference may cause errors in
applications that expect nulls to be handled identically to DB2 or SQL/DS.
This section covers TS/API syntax mapping from DB2 SQL to Teradata SQL.
The following are DB2 commands with an explanation of how each is mapped
to Teradata SQL.
ALTER INDEX
Named indexes are not supported in Teradata SQL, nor does TS/API provide a
functional equivalent. TS/API translates ALTER INDEX into a null statement.
ALTER STOGROUP
The STOGROUP object of DB2 is not supported in Teradata SQL. TS/API
translates ALTER STOGROUP into a null statement.
ALTER TABLE
TS/API performs data type translations as necessary.
The DB2 TIME data type translates to INTEGER FORMAT 99:99:99, and the
DB2 TIMESTAMP data type translates to CHAR(26). FIELDPROC and
VALIDPROC options of DB2 are not currently supported in Teradata SQL, nor
does TS/API provide a functional equivalent. Upon encountering them,
TS/API strips them from the statement.
Note: The Teradata RDBMS limits table size to a maximum of 256 columns.
ALTER TABLESPACE
The TABLESPACE object of DB2 is not supported in Teradata SQL. TS/API
translates ALTER TABLESPACE into a null statement.
COMMENT ON
For a table or a view:
TABLE <tablename>
identical syntax to the Teradata RDBMS COMMENT ON TABLE
TABLE <viewname>
automatically mapped to the Teradata RDBMS COMMENT ON VIEW
For single-column syntax:
COLUMN
identical syntax to the Teradata RDBMS COMMENT ON COLUMN
COMMIT (WORK)
TS/API issues an ET.
CREATE ALIAS
TS/API issues an error message.
CREATE DATABASE
TS/API removes the STOGROUP and BUFFERPOOL options from the query if
they are present. TS/API provides a default PERMSIZE of 10,000 bytes and
takes all other defaults in effect for the initial allocation. If the initial space
allocation or other parameter values are insufficient, use the Teradata SQL
MODIFY DATABASE command to modify them.
CREATE INDEX
Named indexes, VSAM-related options, and descending order are not
permitted on the Teradata RDBMS pre-V2R2 software, nor does TS/API
provide a functional equivalent. TS/API strips the named index and VSAM-
related information from the query and passes it to the Teradata RDBMS.
TS/API passes the descending order parameter to the Teradata RDBMS and the
Teradata RDBMS generates an error message indicating that the user must
check the syntax of the statement. Named Indexes are supported in V2R2
Teradata SQL.
CREATE STOGROUP
The STOGROUP object of DB2 is not supported in Teradata SQL. TS/API
translates CREATE STOGROUP into a null statement.
CREATE SYNONYM
The SYNONYM object does not exist in Teradata SQL. TS/API automatically
translates it to the corresponding Teradata SQL CREATE VIEW statement.
CREATE TABLE
TS/API performs data type translations as necessary.
Note: The Teradata RDBMS limits table size to a maximum of 256 columns.
CREATE TABLESPACE
The TABLESPACE object of DB2 is not supported in Teradata SQL. TS/API
translates CREATE TABLESPACE into a null statement.
CREATE VIEW
The DB2 syntax is identical to Teradata SQL syntax, with the exception of the
WITH CHECK and DISTINCT options, which TS/API strips from the
statement.
DELETE FROM
The DB2 syntax is identical to the Teradata SQL syntax.
DROP
ALIAS
TS/API issues an error message.
DATABASE
DB2 syntax is identical to the Teradata SQL syntax. TS/API considers the
Teradata RDBMS database to be analogous to the DB2 authorization id,
not the DB2 database object. Therefore, when using this command, be
certain that you really want to drop the Teradata RDBMS database
object.
INDEX
The Teradata RDBMS pre-V2R2 software does not support Named Indexes.
TS/API passes the statement unaltered to the Teradata RDBMS, which
generates a syntax error. To drop indexes through TS/API, use a valid
Teradata SQL DROP INDEX statement, specifying the index column
names. Named Indexes are supported in V2R2 Teradata SQL.
STOGROUP
TS/API translates to a null statement.
SYNONYM
TS/API translates to the corresponding DROP VIEW statement.
TABLE
DB2 syntax is identical to the Teradata SQL syntax.
TABLESPACE
TS/API translates to a null statement.
VIEW
DB2 syntax is identical to the Teradata SQL syntax.
EXPLAIN
The DB2 EXPLAIN syntax is not supported in Teradata SQL, nor does TS/API
provide a functional equivalent. TS/API passes the DB2 statement as is to the
Teradata RDBMS, which generates a syntax error. See the Teradata RDBMS
EXPLAIN statement in the Teradata RDBMS Reference Manual (TOS), Volume 2
(Guide to SQL) or the Teradata RDBMS SQL Reference, for details on getting
similar information from the Teradata RDBMS.
GRANT
The GRANT syntax is explained in Table 7-3 through Table 7-7.
DBADM ALL
DBCTRL DATABASE,
MACRO,
TABLE,
USER,
VIEW
DBMAINT SELECT
STATS CHECKPOINT
EXECUTE EXECUTE
SYSADM ALL
ALL ALL
DELETE DELETE
INSERT INSERT
SELECT SELECT
UPDATE UPDATE
INSERT
The DB2 syntax is identical to the Teradata SQL syntax.
LABEL ON
TABLE
TS/API translates to Teradata SQL COMMENT ON TABLE.
COLUMN
TS/API translates to Teradata SQL ALTER TABLE <table name> ADD
<column name> TITLE string constant. VIEW COLUMNS not
supported.
table name
TS/API translates to Teradata SQL ALTER TABLE <table name> ADD
<column name> TITLE string constant for each column specified.
view name
Not supported on the Teradata RDBMS. TS/API issues an error message.
LOCK TABLE
The DB2 syntax is identical to the Teradata SQL syntax.
REVOKE
The REVOKE statement is the exact opposite of the GRANT statement in all
cases. See the GRANT statement explanations earlier in this chapter for the
mapping of the authority of REVOKE.
ROLLBACK [WORK]
TS/API issues ROLLBACK WORK.
SELECT
The DB2 syntax is identical to the Teradata SQL syntax. If the expression is
passed without a Teradata SQL NAMED clause, TS/API adds the appropriate
name. For information about the extended form of the SELECT statement, see
the SELECT statement description under Teradata SQL Extensions later in
this chapter.
UPDATE
The DB2 syntax is identical to the Teradata SQL syntax.
This section covers TS/API syntax mapping from SQL/DS SQL to Teradata
SQL.
The following are SQL/DS commands with an explanation of how each is
mapped to Teradata SQL.
ACQUIRE DBSPACE
The DBSPACE object of SQL/DS is not supported in Teradata SQL. TS/API
translates ACQUIRE DBSPACE into a null statement.
ALTER DBSPACE
The DBSPACE object of SQL/DS is not supported in Teradata SQL. TS/API
translates ALTER DBSPACE into a null statement.
ALTER TABLE
TS/API performs data type translation as necessary. The TIME data type
translates to integer format 99:99:99, and the TIMESTAMP translates to
CHAR(26).
Note: The Teradata RDBMS limits table size to a maximum of 256 columns.
COMMENT ON
For a table or a view:
TABLE <tablename>
identical syntax to the Teradata RDBMS COMMENT ON TABLE
TABLE <viewname>
automatically mapped to the Teradata RDBMS COMMENT ON VIEW
For single-column syntax:
COLUMN
identical syntax to the Teradata RDBMS COMMENT ON COLUMN
For multi-column syntax:
<tablename>
automatically translated to one or more Teradata RDBMS COMMENT ON
COLUMN statements
<viewname>
automatically translated to one or more Teradata RDBMS COMMENT ON
COLUMN statements
CONNECT
TS/API translates the CONNECT <userid> IDENTIFIED BY <password> to
the LOGON statement, LOGON <userid>, <password>. See the TS/API
directive, LOGON, for more information.
CREATE INDEX
Named indexes, VSAM-related options, and descending order are not
permitted on the Teradata RDBMS pre-V2R2 software, nor does TS/API
provide a functional equivalent. TS/API strips the named index and VSAM-
related information from the query. TS/API passes the descending order
parameter to the Teradata RDBMS and the Teradata RDBMS generates an error
message indicating that the user must check the structure of the table. Named
Indexes are supported in V2R2 Teradata SQL.
CREATE SYNONYM
The SYNONYM object does not exist in Teradata SQL. TS/API automatically
translates it to the corresponding Teradata SQL CREATE VIEW statement.
CREATE TABLE
TS/API performs data type translations as necessary.
The Teradata RDBMS has no physical or logical equivalent to the SQL/DS
DATABASE or DBSPACE. The Teradata RDBMS DATABASE is equivalent to
an SQL/DS authorization id, not an SQL/DS DATABASE. Therefore, TS/API
strips the IN database.dbspace clause from the CREATE TABLE statement.
The TIME data type translates to INTEGER FORMAT 99:99:99, and the
TIMESTAMP data type translates to CHAR(26).
SQL/DS tables can have 51 or more columns. The Teradata RDBMS pre-V2R2
software requires that any table of over 50 columns have an accompanying
ALTER TABLE statement for each additional 50 columns. TS/API
automatically creates and executes any ALTER TABLE statements required to
create the table in its entirety and manages the accompanying unit of work.
If an SQL/DS CREATE INDEX statement immediately follows an SQL/DS
CREATE TABLE statement, TS/API automatically strips the index information
from the CREATE INDEX statement and re-creates the table with a Teradata
SQL PRIMARY INDEX clause matching the index definition given on the
CREATE INDEX statement. This avoids a potential performance and data
Note: The Teradata RDBMS limits table size to a maximum of 256 columns.
CREATE VIEW
The SQL/DS syntax is identical to the Teradata SQL syntax.
DELETE FROM
The SQL/DS syntax is identical to the Teradata SQL syntax.
DROP
DBSPACE
TS/API translates to a null statement.
INDEX
The Teradata RDBMS pre-V2R2 software does not support Named Indexes.
TS/API passes the statement unaltered to the Teradata RDBMS, which
generates a syntax error. To drop indexes through TS/API, use a valid
Teradata SQL DROP INDEX statement specifying the index column
names. Named Indexes are supported in V2R2 Teradata SQL.
PROGRAM
Syntax error.
SYNONYM
TS/API translates to the corresponding DROP VIEW statement.
TABLE
The SQL/DS syntax is identical to the Teradata SQL syntax.
VIEW
The SQL/DS syntax is identical to the Teradata SQL syntax.
EXPLAIN
The SQL/DS EXPLAIN syntax is not supported in Teradata SQL, nor does
TS/API provide a functional equivalent. TS/API passes the SQL/DS
statement as is to the Teradata RDBMS, which generates a syntax error. See the
Teradata RDBMS EXPLAIN statement in the Teradata RDBMS Reference Manual
(TOS), Volume 2 (Guide to SQL) or the Teradata RDBMS SQL Reference, for details
on getting similar information from the Teradata RDBMS.
GRANT
The GRANT syntax is explained in Table 7-8 through Table 7-11.
DBA ALL
INSERT
The SQL/DS syntax is identical to the Teradata SQL syntax.
LABEL ON
TABLE
TS/API translates to Teradata SQL COMMENT ON TABLE.
COLUMN
TS/API translates to Teradata SQL ALTER TABLE <table name> ADD
<column name> TITLE string constant. VIEW COLUMNS not
supported.
table name
TS/API translates to Teradata SQL ALTER TABLE <table name> ADD
<column name> TITLE string constant for each column specified.
view name
LOCK
TABLE
The SQL/DS syntax is identical to the Teradata SQL syntax.
DBSPACE
Syntax error.
REVOKE
The REVOKE statement is the exact opposite of the GRANT statement in all
cases. See the GRANTstatement explanations earlier in this chapter for the
mapping of the authority of REVOKE.
SELECT
The SQL/DS syntax is identical to the Teradata SQL syntax. If the expression is
passed without a Teradata SQL NAMED clause, TS/API adds the appropriate
name. See the SELECT statement description under Teradata SQL
Extensions later in this chapter for information about the extended form of
SELECT.
UPDATE
The SQL/DS syntax is identical to the Teradata SQL syntax.
Teradata SQL Extensions are syntax capabilities that extend beyond normal
ANSI, DB2, and SQL/DS syntax. The extensions are supported only on the
Teradata RDBMS. This section explains the extensions by command. For
detailed information on Teradata SQL commands, see the Teradata RDBMS
Reference Manual (TOS), Volume 2 (Guide to SQL) or the Teradata RDBMS SQL
Reference.
These Teradata SQL extensions can easily be exploited by executing QMF SQL
queries containing Teradata SQL extensions syntax or by executing Teradata
SQL Extension syntax queries through the SAS/ACCESS Pass Through Facility.
ABORT
The ABORT command may be used in place of the DB2 and SQL/DS
ROLLBACK. Most applications automatically manage the unit of work for the
user. ABORT allows the user to abnormally terminate a unit of work.
CHECKPOINT
CHECKPOINT places a mark in a journal table, to aid in later recovery.
COLLECT STATISTICS
COLLECT STATISTICS obtains statistical data for one or more columns of a
table that may be used by the Teradata RDBMS to optimize data access.
COMMENT ON
The COMMENT ON command is extended to support comments on the
following:
DATABASE
USER
MACRO
The COMMENT ON command can return data. For the data-returning form of
this command, see the SELECT statement detailed later in this section.
CREATE
The CREATE command is extended to support the following:
DATABASE
USER
MACRO
DATABASE
The DATABASE command establishes a default database for the current
session.
DELETE
The DELETE command is extended to remove all objects from the following:
DATABASE
USER
DROP
The DROP command is extended to drop the following (as long as they are
empty):
DATABASE
USER
DROP INDEX
The DROP INDEX command allows you to drop a secondary index, specifying
the index column names.
DROP MACRO
The DROP MACRO command removes a macro definition from a database.
DROP STATISTICS
The DROP STATISTICS command drops statistical data that was created by a
previous COLLECT STATISTICS command.
EXECUTE macroname
The EXECUTE macroname command executes a macro that was previously
defined using the CREATE MACRO command. The data-returning form of the
EXECUTE macroname command must contain a single statement consisting of
one of the following data-returning Teradata SQL commands:
COMMENT ON
EXPLAIN
HELP
SELECT
SHOW
For more details concerning the data-returning form of this command, see the
SELECT statement detailed later in this section.
GIVE
The GIVE command transfers ownership of a database or a user space to
another user.
GRANT
The GRANT command is extended to support the following:
CREATE DATABASE
CREATE MACRO
CREATE TABLE
CREATE USER
CREATE VIEW
DROP DATABASE
DROP MACRO
DROP TABLE
DROP USER
DROP VIEW
DATABASE
MACRO
TABLE
USER
VIEW
EXECUTE
GRANT (in Version 1 only)
DUMP
RESTORE
CHECKPOINT
HELP
The HELP command obtains Data Dictionary/Directory information about a
specified database, user, table, view, macro, column, or index. For the data-
returning form of this command, see the SELECT statement detailed later in
this section.
MODIFY
The MODIFY command changes options specified at creation time for the
following:
DATABASE
USER
Multi-Statement Requests
The Teradata RDBMS is capable of receiving two or more Teradata SQL
statements in one request and handling them in parallel. This type of request is
called a multi-statement request. Three restrictions to this capability exist:
If present, a DDL statement (ALTER, CREATE, or DROP) must be the last
statement in a multi-statement request. This is a Teradata RDBMS
restriction.
The SELECT or any other data-returning command cannot be included in a
multi-statement request. This is a TS/API restriction.
The SAS System does not allow multi-statement requests.
When using the SAS System under MVS or VM, if you have an extended IBM
keyboard, you can use the } symbol to denote an end-of-statement delimiter.
TS/API translates the } symbol to a semicolon (;) prior to sending the multi-
statement request to the Teradata RDBMS.
The Teradata RDBMSs parallel processing capability for multi-statement
requests applies to the following commands:
DELETE
INSERT
UPDATE
RENAME
The RENAME command renames the following existing objects:
MACRO
TABLE
VIEW
REVOKE
The Extensions to the REVOKE statement are the exact opposite of the
Extensions to the GRANT statement in all cases. See the GRANT statement
Extensions earlier in this section for the authority of REVOKE.
SELECT
The normal Teradata SQL SELECT can be used to return data to the user.
Additionally, the Extensions to the following data-returning commands return
data to the user when preceded by the SELECT:
COMMENT ON
EXECUTE or EXEC
EXPLAIN
HELP
SHOW
Teradata SQL statements do not properly return data to the user unless the
above commands are preceded by a SELECT command. This is due to QMF
data retrieval logic.
TS/API automatically removes the SELECT command from the statement and
passes the remainder of the data-returning statement on to the Teradata
RDBMS for normal handling. This technique provides the capability of using
the Teradata SQL Extensions data-returning commands via TS/API. The
following example shows how to use the data-returning form of the SHOW
command:
SELECT SHOW TABLE PERSONNEL.EMPLOYEE
SHOW
The SHOW command displays the data definition statement most recently
used to create, modify, or replace the specified macro, view, or table. For the
data-returning form of this command, see the SELECT statement detailed
earlier in this section.
TS/API Directives
Introduction
Directives are statements that can be issued from within the DBCLOGON file
or from the application passthrough screen. Most commonly, they control
CLIv2 options or some form of special processing not directly related to
Teradata SQL.
The following are TS/API Directives, with a brief description of each.
DEBUG
Activates the TS/API debug facility. See Chapter 5: Problem Management for
details.
LOGON
The LOGON statement takes the form:
LOGON [<tdpid>/] <userid>, <password>;
Note: The symbols, < and >, are not part of the specification. Replace these
symbols and the text within them with the appropriate information.
Unless you use a logon exit, the logon statement in the DBCLOGON file is used
to build the CLIv2 logon request to the Teradata RDBMS.
LOGOFF
The LOGOFF command logs you off the current session.
Any outstanding unit of work is automatically committed prior to the
execution of either the LOGON or LOGOFF commands.
DEBUG PERF
This directive causes TS/API to create performance monitoring information.
TS/API places the performance monitoring information in the TS/API
OUTPUT file.
Performance monitoring is acquired from the timestamp fields located in the
DBCAREA CLIv2 communication block. The following table describes these
fields:
HSISVC_Time The date and time that the request left TS/API.
TDPWAIT_Time The time the request arrived at the TDP from CLIv2.
TDPDBI_Time The time the response arrived at the TDP from the
Teradata RDBMS.
See Chapter 5: Problem Management for details on the TS/API OUTPUT file.
where:
ASCII Specifies that comparison and sort operations are to use ASCII
collation.
MULTINATIONAL Specifies that comparison and sort operations are to use the
International sort sequence.
IF the... THEN...
HOST This is the default. Specifies that collation for the session is to
agree with the collation of the logon client (EBCDIC for IBM
mainframe clients, ASCII for all others).
Translation Tables
Error Codes
-010 3760
-101 2664, 3509, 3540, 3597, 3609, 3629, 3702, 3705, 3710, 3712, 3714, 3741, 3850,
3851, 3867, 3896
-102 3738
-104 2667, 3521, 3525, 3531, 3536, 3541, 3543, 3544, 3551, 3552, 3553, 3557, 3558,
3559, 3561, 3562, 3567, 3576, 3579, 3585, 3588, 3590, 3605, 3612, 3623, 3624,
3625, 3630, 3631, 3632, 3633, 3634, 3636, 3645, 3646, 3648, 3649, 3703, 3706,
3707, 3708, 3709, 3727, 3728, 3735, 3736, 3739, 3761, 3763, 3764, 3765, 3766,
3768, 3770, 3771, 3772, 3773, 3776, 3779, 3784, 3786, 3788, 3792, 3793, 3796,
3797, 3798, 3806, 3808, 3815, 3849, 3852, 3853, 3854, 3855, 3859, 3860, 3861,
3863, 3870, 3871, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3882, 3886, 3887,
3888, 3890, 3926, 3933, CLI530, 3750, 3952, 3958, 3964, 3965, 3967, 5316
-107 3737
-109 3507
-119 3554
-125 3637
-128 3731
-137 3578
-150 3823
-151 3659
-156 3891
-171 2603, 2604, 2605, 2606, 2607, 2608, 2622, 2623, 3580, 3581, 3647, 3660, 3662,
3663, 3819, 3857, 3946, 3950, 3951, 3963, 3966
-172 3732
-199 3516
-205 3810
-207 3848
-405 3753
-408 3814
-415 3654
-530 2700
-552 3545
-554 3542
-602 3518
-603 3534
-618 3571
-802 2161, 2162, 2163, 2164, 2165, 2166, 2232, 2233, 2239, 2240, 2614, 2615, 2616,
2617, 2618, 2619, 2620, 2621, 2661, 2674, 2675, 2676, 2677, 2678, 2679, 2682,
2683, 2684, 2685, 2686, 2687, 3532, 3535, 3641, 3642, 3754, 3755, 3756, 3757,
3758, 3953, 3954, 3955, 3961, 3962
-811 3669
-922 3002, 3003, 3004, 3014, 3015, 3016, 3023, CLI040, CLI041, CLI272, CLI370,
CLI521, CLI524, CLI527
-923 3006, 3007, CLI151, CLI155, CLI280, CLI282, CLI368, CLI369, CLI426,
CLI427, CLI512, CLI513, CLI514
Teradata RDBMS
SQLCODE
Error Code
2147 -401
2149 -401
2161 -802
2162 -802
2163 -802
Teradata RDBMS
SQLCODE
Error Code
2164 -802
2165 -802
2166 -802
2232 -802
2233 -802
2239 -802
2240 -802
2450 -911
2603 -171
2604 -171
2605 -171
2606 -171
2607 -171
2608 -171
2614 -802
2615 -802
2616 -802
2617 -802
2618 -802
2619 -802
2620 -802
2621 -802
2622 -171
2623 -171
2631 -911
2661 -802
2662 -138
2663 -138
2664 -101
Teradata RDBMS
SQLCODE
Error Code
2665 -182
2666 -182
2667 -104
2673 -313
2674 -802
2675 -802
2676 -802
2677 -802
2678 -802
2679 -802
2682 -802
2683 -802
2684 -802
2685 -802
2686 -802
2687 -802
2689 -407
2700 -530
2801 -803
2802 -803
2803 -803
2805 -905
2825 -911
2826 -911
2827 -901
2828 -901
2843 -905
2938 -901
2977 -905
Teradata RDBMS
SQLCODE
Error Code
3002 -922
3003 -922
3004 -922
3006 -923
3007 -923
3014 -922
3015 -922
3016 -922
3023 -922
3110 -901
3111 -911
3120 -901
3130 -905
3504 -122
3507 -109
3509 -101
3511 -084
3513 -901
3514 -901
3515 -612
3516 -199
3517 -612
3518 -602
3519 -601
3520 -404
3521 -104
3523 -551
3524 -551
3526 -204
Teradata RDBMS
SQLCODE
Error Code
3527 -060
3528 -060
3529 -060
3530 -060
3531 -104
3532 -802
3534 -603
3535 -802
3536 -104
3539 -204
3540 -101
3541 -104
3542 -554
3543 -104
3544 -104
3545 -552
3546 -604
3551 -104
3552 -104
3553 -104
3554 -119
3556 -680
3557 -104
3558 -104
3559 -104
3560 -612
3561 -104
3564 -404
3566 -905
Teradata RDBMS
SQLCODE
Error Code
3567 -104
3568 -112
3569 -120
3571 -618
3574 -120
3576 -104
3577 -905
3578 -137
3579 -104
3580 -171
3581 -171
3582 -680
3585 -104
3588 -104
3590 -104
3593 -313
3594 -312
3595 -312
3597 -101
3599 -312
3600 -312
3603 -911
3604 -407
3605 -104
3606 -121
3607 -421
3608 -421
3609 -101
3612 -104
Teradata RDBMS
SQLCODE
Error Code
3617 -060
3622 -402
3623 -104
3624 -104
3625 -104
3627 -112
3628 -112
3629 -101
3631 -104
3632 -104
3633 -104
3634 -104
3636 -104
3637 -125
3638 -905
3639 -401
3640 -401
3641 -802
3642 -802
3643 -402
3644 -402
3645 -104
3646 -104
3647 -171
3648 -104
3649 -104
3653 -421
3654 -415
3656 -204
Teradata RDBMS
SQLCODE
Error Code
3659 -151
3660 -171
3661 -905
3662 -171
3663 -171
3669 -811
3696 -113
3697 -113
3702 -101
3703 -104
3704 -110
3705 -101
3706 -104
3707 -104
3708 -104
3709 -104
3710 -101
3712 -101
3714 -101
3727 -104
3728 -104
3729 -604
3731 -128
3732 -172
3733 -637
3735 -104
3736 -104
3737 -107
3738 -102
Teradata RDBMS
SQLCODE
Error Code
3739 -104
3741 -101
3744 -601
3750 -104
3751 -103
3752 -103
3753 -405
3754 -802
3755 -802
3756 -802
3757 -802
3758 -802
3759 -103
3760 -010
3761 -104
3763 -104
3764 -104
3765 -104
3766 -104
3768 -104
3770 -104
3771 -104
3772 -104
3773 -104
3775 -110
3776 -104
3779 -104
3784 -104
3786 -104
Teradata RDBMS
SQLCODE
Error Code
3788 -104
3789 -637
3792 -104
3793 -104
3796 -104
3797 -104
3798 -104
3801 -601
3802 -204
3803 -601
3804 -601
3805 -601
3806 -104
3807 -204
3808 -104
3809 -203
3810 -205
3811 -407
3812 -117
3813 -117
3814 -408
3815 -104
3816 -170
3817 -170
3818 -170
3819 -171
3820 -170
3821 -170
3822 -203
Teradata RDBMS
SQLCODE
Error Code
3823 -150
3824 -204
3848 -207
3849 -104
3850 -101
3851 -101
3852 -104
3853 -104
3854 -104
3855 -104
3856 -551
3857 -171
3858 -551
3859 -104
3860 -104
3861 -104
3863 -104
3865 -551
3866 -551
3867 -101
3868 -203
3870 -104
3871 -104
3872 -120
3873 -104
3874 -104
3875 -104
3876 -104
3877 -104
Teradata RDBMS
SQLCODE
Error Code
3878 -104
3879 -104
3880 -551
3881 -551
3882 -104
3883 -122
3885 -121
3886 -104
3887 -104
3888 -104
3889 -637
3890 -104
3891 -156
3896 -101
3897 -901
3919 -680
3926 -104
3933 -104
3941 -084
3946 -171
3950 -171
3951 -171
3952 -104
3953 -802
3954 -802
3955 -802
3956 -110
3957 -113
3958 -104
Teradata RDBMS
SQLCODE
Error Code
3959 -401
3960 -401
3961 -802
3962 -802
3963 -171
3964 -104
3965 -104
3966 -171
3967 -104
3978 -104
5316 -104
5317 -104
6706 -104
CLI040 -922
CLI041 -922
CLI151 -923
CLI155 -923
CLI272 -922
CLI280 -923
CLI282 -923
CLI368 -923
CLI369 -923
CLI370 -922
CLI426 -923
CLI427 -923
CLI512 -923
CLI513 -923
CLI514 -923
CLI521 -922
Teradata RDBMS
SQLCODE
Error Code
CLI524 -922
CLI527 -922
CLI530 -104
-084 3941
-101 2664, 2843, 2977, 3130, 3509, 3540, 3566, 3597, 3609, 3629, 3638, 3661,
3702, 3705, 3710, 3712, 3714, 3741, 3850, 3851, 3867, 3896, 3578
-102 3738
-104 2667, 3516, 3521, 3525, 3531, 3536, 3541, 3543, 3544, 3551, 3552, 3553,
3557, 3558, 3559, 3561, 3562, 3567, 3571, 3576, 3579, 3585, 3588, 3590,
3605, 3612, 3623, 3624, 3625, 3630, 3631, 3632, 3633, 3634, 3636, 3641,
3642, 3645, 3646, 3648, 3649, 3703, 3706, 3707, 3708, 3709, 3727, 3728,
3733, 3735, 3736, 3739, 3761, 3763, 3764, 3765, 3766, 3768, 3770, 3771,
3772, 3773, 3776, 3779, 3784, 3786, 3788, 3789, 3792, 3793, 3796, 3797,
3798, 3806, 3808, 3815, 3849, 3852, 3853, 3854, 3855, 3859, 3860, 3861,
3863, 3868, 3870, 3871, 3873, 3874, 3875, 3876, 3877, 3878, 3879, 3882,
3886, 3887, 3888, 3889, 3890, 3926, 3933, CLI530, 6706
-106 3760
-107 3737
-109 3507
-110 3732
-125 3637
-128 3731
-150 3823
-151 3659
-168 2603, 2604, 2605, 2606, 2607, 2608, 2622, 2623, 2662, 2663, 3580, 3581,
3647, 3660, 3662, 3663, 3816, 3817, 3818, 3819, 3820, 3821, 3857
-205 3810
-207 3848
-405 3753
-408 3814
-413 2661
-530 2700
-552 3545
-554 3542
-603 3534
-617 3518
-802 2161, 2162, 2163, 2164, 2165, 2166, 2232, 2233, 2239, 2240, 2614, 2615,
2616, 2617, 2618, 2619, 2674, 2675, 2676, 2677, 2678, 2682, 2683, 2684,
2685, 2686, 3754, 3755, 3756, 3757, 3758
-810 3669
-813 3891
-940 3006, 3007, CLI151, CLI155, CLI280, CLI282, CLI368, CLI369, CLI426,
CLI427, CLI512, CLI513, CLI514
Teradata RDBMS
SQLCODE
Error Code
2147 -401
2149 -401
2161 -802
2162 -802
2164 -802
2165 -802
2166 -802
2232 -802
Teradata RDBMS
SQLCODE
Error Code
2233 -802
2239 -802
2240 -802
2450 -911
2603 -168
2604 -168
2605 -168
2606 -168
2607 -168
2608 -168
2614 -802
2615 -802
2616 -802
2617 -802
2618 -802
2619 -802
2620 -410
2621 -410
2622 -168
2623 -168
2631 -911
2661 -413
2662 -168
2663 -168
2664 -101
2665 -401
2666 -401
2667 -104
2673 -313
Teradata RDBMS
SQLCODE
Error Code
2674 -802
2675 -802
2676 -802
2677 -802
2678 -802
2679 -410
2682 -802
2683 -802
2684 -802
2685 -802
2686 -802
2687 -410
2689 -407
2700 -530
2801 -803
2802 -803
2803 -803
2805 -809
2825 -911
2826 -911
2827 -914
2828 -901
2843 -101
2938 -914
2977 -101
3002 -564
3003 -560
3004 -561
3006 -940
Teradata RDBMS
SQLCODE
Error Code
3007 -940
3014 -561
3015 -560
3016 -564
3023 -564
3110 -914
3111 -911
3120 -901
3130 -101
3504 -119
3507 -109
3509 -101
3513 -914
3514 -914
3515 -612
3516 -104
3517 -612
3518 -617
3519 -601
3520 -404
3521 -104
3523 -551
3524 -551
3525 -104
3526 -204
3527 -105
3528 -105
3529 -105
3530 -105
Teradata RDBMS
SQLCODE
Error Code
3531 -104
3532 -401
3534 -603
3535 -410
3536 -104
3537 -204
3538 -204
3539 -204
3540 -101
3541 -104
3542 -554
3543 -104
3544 -104
3545 -552
3546 -604
3551 -104
3552 -104
3553 -104
3554 -119
3556 -602
3557 -104
3558 -104
3559 -104
3560 -612
3561 -104
3562 -104
3564 -404
3566 -101
3567 -104
Teradata RDBMS
SQLCODE
Error Code
3568 -112
3569 -120
3571 -104
3574 -120
3576 -104
3577 -809
3578 -101
3579 -104
3580 -168
3581 -168
3582 -602
3585 -104
3588 -104
3590 -104
3593 -313
3594 -314
3595 -314
3597 -101
3599 -314
3600 -314
3603 -911
3604 -407
3605 -104
3606 -121
3607 -415
3608 -415
3609 -101
3612 -104
3617 -105
Teradata RDBMS
SQLCODE
Error Code
3622 -402
3623 -104
3624 -104
3625 -104
3627 -112
3628 -112
3629 -101
3630 -104
3631 -104
3632 -104
3633 -104
3634 -104
3636 -104
3637 -125
3638 -101
3639 -401
3640 -401
3641 -104
3642 -104
3643 -402
3644 -402
3645 -104
3646 -104
3647 -168
3648 -104
3649 -104
3653 -415
3654 -415
3656 -204
Teradata RDBMS
SQLCODE
Error Code
3659 -151
3660 -168
3661 -101
3662 -168
3663 -168
3669 -810
3702 -101
3703 -104
3704 -167
3705 -101
3706 -104
3707 -104
3708 -104
3709 -104
3710 -101
3712 -101
3714 -101
3727 -104
3728 -104
3729 -604
3731 -128
3732 -110
3733 -104
3735 -104
3736 -104
3737 -107
3738 -102
3739 -104
3741 -101
Teradata RDBMS
SQLCODE
Error Code
3744 -601
3751 -103
3752 -103
3753 -405
3754 -802
3755 -802
3756 -802
3757 -802
3758 -802
3759 -410
3760 -106
3761 -104
3763 -104
3764 -104
3765 -104
3766 -104
3768 -104
3770 -104
3771 -104
3772 -104
3773 -104
3775 -167
3776 -104
3779 -104
3784 -104
3786 -104
3788 -104
3789 -104
3792 -104
Teradata RDBMS
SQLCODE
Error Code
3793 -104
3796 -104
3797 -104
3798 -104
3801 -601
3802 -204
3803 -601
3804 -601
3805 -601
3806 -104
3807 -204
3808 -104
3809 -203
3810 -205
3811 -407
3812 -117
3813 -117
3814 -408
3815 -104
3816 -168
3817 -168
3818 -168
3819 -168
3820 -168
3821 -168
3822 -203
3823 -150
3824 -204
3848 -207
Teradata RDBMS
SQLCODE
Error Code
3849 -104
3850 -101
3851 -101
3852 -104
3853 -104
3854 -104
3855 -104
3856 -551
3857 -168
3858 -551
3859 -104
3860 -104
3861 -104
3863 -104
3865 -551
3866 -551
3867 -101
3868 -104
3870 -104
3871 -104
3872 -120
3873 -104
3874 -104
3875 -104
3876 -104
3877 -104
3879 -104
3880 -551
3881 -551
Teradata RDBMS
SQLCODE
Error Code
3882 -104
3883 -119
3885 -121
3886 -104
3887 -104
3888 -104
3889 -104
3890 -104
3891 -813
3896 -101
3897 -901
3919 -602
3926 -104
3933 -104
3941 -084
3978 -104
5317 -104
CLI040 -564
CLI041 -564
CLI151 -940
CLI155 -940
CLI272 -564
CLI280 -940
CLI282 -940
CLI368 -940
CLI369 -940
CLI370 -815
CLI426 -940
CLI427 -940
Teradata RDBMS
SQLCODE
Error Code
CLI512 -940
CLI513 -940
CLI514 -940
CLI521 -561
CLI524 -815
CLI527 -564
CLI530 -104
This appendix describes the SYSIBM and SYSTEM databases on the Teradata
RDBMS.
SYSIBM.SYSVIEWS Views
SYSIBM .SYSCOLAUTH
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished to support DB2 application
programs that may interrogate for DB2 column authorizations. Because the
Teradata RDBMS does not support column authorizations, zero rows are
always returned from any query. The following table describes
SYSIBM.SYSCOLAUTH.
SYSIBM .SYSCOLUMNS
This view joins data from the DBC.DBASE, DBC.TVM, and DBC.TVFIELDS
system catalog tables to emulate the SYSIBM.SYSCOLUMNS table. Each row
defines one column from a table or view description stored in the Teradata
RDBMS system catalog. The following table describes SYSIBM.SYSCOLUMNS.
Teradata
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Name
RDBMS Type
The following table explains how each column is supported and how its value
may vary from the expected DB2 value:
NAME Column name. The DB2 length of 18 is expanded to a length of 31 to accommodate the
longer fieldnames available in Teradata SQL
TBNAME Table or view names. The DB2 length of 18 is expanded to a length of 31 to accommodate
the longer table names available in Teradata SQL
TBCREATOR The Teradata RDBMS userid under which the table or view was created. The DB2 length of
eight is expanded to 31 to accommodate the longer userid names available in Teradata SQL
COLCARD Set to -1 indicating that statistics have not been gathered. Teradata RDBMS statistics are not
relevant to DB2 use.
HIGH2KEY Set to blank indicating no HIGH2KEY information. The Teradata RDBMS does not have
relevant key range information.
LOW2KEY Set to blank indicating no LOW2KEY information. The Teradata RDBMS does not have
relevant key range information.
UPDATES Set to Y indicating that the field is updatable. If this is a view, the field may not be
updatable. In that case, an error occurs if an application attempts to update the field.
IBMREQD Set to N indicating that the row does not come from the basic machine-readable tape.
DEFAULT Set to N indicating that the field does not contain a default value. This may not be correct
if the field contains a DEFAULT clause in the table description.
KEYSEQ Set to zero indicating that the field is not part of the primary key. This setting may not be
correct if the field is part of the primary key.
FOREIGNKEY Set to N indicating that the field is not part of a foreign key. The Teradata RDBMS does not
provide catalog support for foreign keys.
FLDPROC Set to N indicating that the field does not have a field procedure. The Teradata RDBMS
currently does not support field procedures.
LABEL The field title. The DB2 length of 30 is expanded to a length of 60 to accommodate the
longer field titles available in Teradata SQL.
SYSIBM.SYSCOPY
This view is a SELECT of constants used to emulate the SYSIBM.SYSCOPY
table, which contains information needed for recovery. The following table
describes SYSIBM.SYSCOPY.
Teradata
IBM Name IBM Type Teradata RDBMS Name Teradata RDBMS Type
RDBMS Table
The following table explains how each column is supported and how its value
may vary from the expected DB2 value:
TSNAME Table space; set to DSNDB04. Table spaces are not defined on the Teradata RDBMS.
ICTYPE Set to F. The operation is always full-image copy on the Teradata RDBMS.
ICDATE Set to 880101. The date of the entry is not defined on the Teradata RDBMS.
START_RBA Set to blank. The DB2 log is not used on the Teradata RDBMS.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
DSNAME Data set name; set to blanks. The data set name is not available on the Teradata RDBMS.
ICTIME The time at which the row was inserted; set to 000000. Not available on the Teradata RDBMS.
TIMESTAMP Set to ?, indicating that no timestamp is available. This column is generally unused by users or
application programs.
ICBACUP Indicates whether the Image Copy dataset is for the primary or secondary system.
SYSIBM .SYSDATABASE
This view is a SELECT of constants used to emulate the
SYSIBM.SYSDATABASE table. The table contains one row for the DSNDB04
database. The following table describes SYSIBM.SYSDATABASE in detail.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable
tape
SYSIBM .SYSDBAUTH
This view joins data from the DBC.DBASE and DBC.ACCESSRIGHTS catalog
tables to emulate the SYSIBM.SYSDBAUTH table, which records user
privileges on databases. The following table describes SYSIBM.SYSDBAUTH.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
GRANTOR The Teradata RDBMS user who granted an access right. The DB2 length of eight is
expanded to 31 to accommodate the longer userid names available in Teradata SQL.
GRANTEE The Teradata RDBMS user who was granted an access right. The DB2 length of eight is
expanded to 31 to accommodate the longer userid names available in Teradata SQL.
NAME The name of a table or view in the Teradata RDBMS. The DB2 length of 18 characters is
expanded to a length of 31 to allow for longer table names on the Teradata RDBMS.
TIMESTAMP Set to ?, indicating that no timestamp is available. This column is generally not used
by users or application programs.
DATEGRANTED Set to ?, indicating that no date is available. This column is generally not used by users
or application programs.
TIMEGRANTED Set to ?, indicating that no time is available. This column is generally not used by
users or application programs.
GRANTEETYPE Set to blank, reflecting that the grantee is a user. Because the Teradata RDBMS cannot
grant access rights to programs, only blank is valid.
AUTHHOWGOT Authorization of the user from whom privileges were received. Always set to D
(DBADM).
CREATETABAUTH Whether GRANTEE can create tables within a database; two types exist:
Authority not held
Privilege held without GRANT option
Authority held with GRANT option is not defined to the Teradata RDBMS.
CREATETSAUTH Whether GRANTEE can create table spaces; two types exist:
Authority not held
Privilege held without GRANT option
Authority held with GRANT option is not defined to the Teradata RDBMS.
DBADMAUTH Whether GRANTEE has DBADM authority over database; two types exist:
Authority not held
Privilege held without GRANT option
Authority held with GRANT option is not defined to the Teradata RDBMS.
DBCTRLAUTH Whether GRANTEE has DBCTRL authority over a database; not defined to the
Teradata RDBMS. Blank is returned.
DBMAINTAUTH Whether GRANTEE has DBMAINT authority over database; not defined to the
Teradata RDBMS. Blank is returned.
DISPLAYDBAUTH Whether GRANTEE can issue the DISPLAY command for the database; not defined to
the Teradata RDBMS. Blank is returned.
DROPAUTH Whether GRANTEE can drop the database; two types exist:
Authority not held
Privilege held without GRANT option
Authority held with GRANT option is not defined to the Teradata RDBMS.
IMAGCOPYAUTH Whether GRANTEE can use the COPY and MERGECOPY utilities; not defined to the
Teradata RDBMS. Blank is returned.
LOADAUTH Whether GRANTEE can use the LOAD utility; not defined to the Teradata RDBMS.
Blank is returned.
REORGAUTH Whether GRANTEE can use the REORG utility; not defined to the Teradata RDBMS.
Blank is returned.
RECOVERDBAUTH Whether GRANTEE can use the RECOVER utility; not defined to the Teradata RDBMS.
Blank is returned.
REPAIRAUTH Whether GRANTEE can use REPAIR utility; not defined to the Teradata RDBMS. Blank
is returned.
STARTDBAUTH Whether GRANTEE can issue the START command; not defined to the Teradata
RDBMS. Blank is returned.
STATSAUTH Whether GRANTEE can use the RUNSTATS utility; not defined to the Teradata
RDBMS. Blank is returned.
STOPAUTH Whether GRANTEE can issue the STOP command; not defined to the Teradata
RDBMS. Blank is returned.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
SYSIBM.SYSDBRM
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished solely for the purpose of
properly supporting DB2 application programs that may interrogate for a DB2
DBRM. The Teradata RDBMS does not support DBRMs, so zero rows are
always returned from any query. See the following table for a description of
SYSIBM.SYSDBRM.
SYSIBM.SYSFIELDS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support
FIELDPROCS, and TS/API does not emulate them. Therefore, zero rows are
always retrieved from any query. This view is furnished solely for the purpose
of supporting DB2 application programs that may interrogate which fields
have FIELDPROCS. The following table describes SYSIBM.SYSFIELDS.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSFOREIGNKEYS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished solely for the purpose of
properly supporting DB2 application programs that may interrogate for DB2
foreign keys. The Teradata RDBMS does not support foreign key definitions.
The following table describes SYSIBM.SYSFOREIGNKEYS.
SYSIBM .SYSINDEXES
This view joins data from DBC.DBASE, DBC.TVM, and DBC.INDEXES catalog
tables to emulate the SYSIBM.SYSINDEXES table. The table contains one row
for every index. The following table describes SYSIBM.SYSINDEXES.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
NAME The Teradata RDBMS does not support named indexes, so index name is derived from the
TABLEID and INDEXNUMBER fields in the DBC.INDEXES table.
DBNAME Name of the database containing the index. Field length of eight is expanded to 31 to
accommodate the longer names in Teradata SQL.
INDEXSPACE Set to NOIXNAME. Index spaces are not defined in Teradata SQL environment.
FIRSTKEYCARD The number of distinct values of the first 8 bytes of the key; set to 1.
NLEAF The number of levels in index tree; set to 1. Index tree is not defined in the Teradata SQL
environment.
DSETPASS Password for the data sets of the index; set to blanks. Not defined in Teradata SQL
environment.
CLOSERULE Set to Y. Data sets considered closed when the index is not in use.
SPACE Set to 0. DASD storage for indexes not defined in the Teradata SQL environment.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
SYSIBM .SYSINDEXPART
This view joins data from the DBC.DBASE, DBC.TVM, and DBC.INDEXES
catalog tables to emulate the SYSIBM.SYSINDEXPART table. The table contains
one row for each index. The following table describes
SYSIBM.SYSINDEXPART.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
IXNAME The Teradata RDBMS does not support named indexes, so the index name is derived
from the TABLEID and INDEXNUMBER fields in the DBC.INDEXES table. Not defined
in Teradata SQL.
SQTY Set to 0.
CARD Statistics not gathered for the number of rows referenced by the index. Set to -1.
FAROFFPOS Statistics not gathered for optimal positioning information in relation to index. Set to -1.
IBMREQD Indicates whether a row comes from the basic machine-readable tape. Set to N.
SYSIBM.SYSKEYS
This view joins data from the DBC.DBASE, DBC.INDEXES, DBC.TVM, and
DBC.TVFIELDS catalog tables to emulate the SYSIBM.SYSKEYS table, which
contains one row for each column of an index key. The following table
describes SYSIBM.SYSKEYS.
Teradata
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Name
RDBMS Type
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
IXNAME The Teradata RDBMS does not support named indexes, so index name is derived from the
TABLEID and INDEXNUMBER fields in the DBC.INDEXES table.
COLNAME Name of the column of the key. Field length of eight is expanded to 31 to accommodate the
longer names in Teradata SQL.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
SYSIBM.SYSLINKS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished only to support DB2
application programs that may interrogate for DB2 links. The Teradata RDBMS
does not support DB2 links. The following table describes SYSIBM.SYSLINKS.
Teradata
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Type
RDBMS Name
SYSIBM.SYSPLAN
The SYSIBM.SYSPLAN table correlates the names of Teradata RDBMS macros
emulating static SQL with the DB2 plan names that are passed from application
programs. SYSIBM.SYSPLAN is built and maintained by TS/API and its
installation procedures. The following table describes SYSIBM.SYSPLAN.
Teradata
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Name
RDBMS Type
WARNING
Any user modification of SYSIBM.SYSPLAN may invalidate the integrity of
TS/API.
NAME The plan name that is passed from an application program at execution time.
CREATOR The userid under which the plan macros are stored. This is currently limited to eight
characters, since that is the size of the authorization ID passed from a DB2 application.
The remaining columns in SYSIBM.SYSPLAN are set to default values and not
used by TS/API.
SYSIBM .SYSPLANAUTH
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support user
privileges on application plans. The following table describes
SYSIBM.SYSPLANAUTH.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSPLANDEP
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support, nor does
TS/API emulate, a referential integrity relationship between plans and the
tables, views, or indexes contained in them. The following table describes
SYSIBM.SYSPLANDEP.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM.SYSRELS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support
relationships between tables. The following table describes SYSIBM.SYSRELS.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSRESAUTH
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support privileges
on buffer pools, storage groups, or table spaces. The following table describes
SYSIBM.SYSRESAUTH.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM.SYSSTMT
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support the
SYSIBM.SYSSTMT table. The following table describes SYSIBM.SYSSTMT.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSSTOGROUP
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. The Teradata RDBMS does not support storage
groups; therefore, zero rows are always returned from any query of this table.
The following table describes SYSIBM.SYSSTOGROUP.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSSYNONYMS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished solely for the purpose of
properly supporting DB2 application programs that may interrogate for DB2
synonyms. The Teradata RDBMS does not support synonyms, so zero rows are
always returned from any query. The following table describes
SYSIBM.SYSSYNONYMS.
Teradata Teradata
IBM Name IBM Type Teradata RDBMS Table
RDBMS Name RDBMS Type
SYSIBM .SYSTABAUTH
This view joins data from the DBC.ACCESSRIGHTS, DBC.TVM, and
DBC.DBASE catalog tables to emulate the SYSIBM.SYSTABAUTH table.
SYSIBM.SYSTABAUTH records user privileges on tables and views. The
following table describes SYSIBM.SYSTABAUTH.
Teradata
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Name
RDBMS Type
The following table describes how each column is supported and how its value
may vary from the expected DB2 value.
GRANTOR The Teradata RDBMS user who granted the access right. The DB2 length of eight is
expanded to 31 to accommodate the longer userid names available in Teradata SQL.
GRANTEE The Teradata RDBMS user who was granted the access right. The DB2 length of eight is
expanded to 31 to accommodate the longer userid names available in Teradata SQL.
GRANTEETYPE Set to blank, reflecting that the grantee is a user. The Teradata RDBMS cannot grant
access rights to programs, so only blank is valid.
DBNAME Name of the database on which GRANTOR has authority. The DB2 length of eight is
expanded to 31 to accommodate the longer database names available in Teradata SQL.
SCREATOR The Teradata RDBMS userid who created the table or view on which rights have been
granted. The DB2 length of eight is expanded to 31 to accommodate the longer userid
names available in Teradata SQL.
STNAME The name of the table or view on which rights have been granted. The DB2 length of
eight is expanded to 31 to accommodate the longer table names available in Teradata
SQL.
TCREATOR The same value as SCREATOR. This value is not valid for views, since the Teradata
RDBMS provides information only about the rights to the view itself, not about
underlying tables. Like SCREATOR, this column is expanded to 31 characters.
TTNAME The same value as STNAME. This value is not valid for views, since the Teradata
RDBMS provides information only about the rights to the view itself, not about
underlying tables. Like STNAME, this column is expanded to 31 characters.
AUTHHOWGOT Set to blank. The Teradata RDBMS does not support authorization level.
TIMESTAMP Set to ?, indicating that no timestamp is available. This column is generally not used by
users or application programs.
DATEGRANTED Set to ?, indicating that no grant date is available. This column is generally not used by
users or application programs.
TIMEGRANTED Set to ?, indicating that no time granted is available. This column is generally not used
by users or application programs.
UPDATECOLS Set to blank, indicating that any update privileges apply equally to all columns in a
table.
DELETEAUTH Whether GRANTEE can delete rows from the table or view:
blank - no privilege
Y - privilege
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
SYSIBM .SYSTABLEPART
This table emulates the SYSIBM.SYSTABLEPART table. The table contains one
row for the DSNDB04 table space. The following table describes
SYSIBM.SYSTABLEPART.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
IXNAME Partitioned indexes not defined under Teradata SQL environment Blanks
STORNAME Blanks
IBMREQD Whether the row comes from the basic machine-readable tape N
FREEPAGE Pages left as free space not defined under Teradata SQL environment 0
SYSIBM.SYSTABLES
This view joins data from the DBC.DBASE and DBC.TVM catalog tables to
emulate the SYSIBM.SYSTABLES table. Each row defines one table or view
stored in the Teradata RDBMS system catalog. The following table describes
SYSIBM.SYSTABLES:
Teradata RDBMS
IBM Name IBM Type Teradata RDBMS Name Teradata RDBMS Type
Table
Teradata RDBMS
IBM Name IBM Type Teradata RDBMS Name Teradata RDBMS Type
Table
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
NAME The name of a table or view in the Teradata RDBMS. The DB2 length of 18 characters is
expanded to a length of 31 to allow for longer table names on the Teradata RDBMS.
CREATOR The name of the user who created the table or view. The DB2 length of 8 characters is
expanded to a length of 31 to allow for longer userids on the Teradata RDBMS.
TYPE Indicates whether this description applies to a table (T) or a view (V).
DBNAME The name of the user who created the table or view. This column is identical to
CREATOR. The DB2 length of 8 characters is expanded to a length of 31 to allow for
longer userids on the Teradata RDBMSRDBMS.
TSNAME The Teradata RDBMS does not support the concept of table spaces. The table space name
reflected to the application is the same as the table name.
DBID Set to zero, indicating that this is a DB2 view. This indication may generate erroneous
results if an application depends on the value stored in this column. A valid database ID
is not available in the Teradata RDBMS for this column.
OBID Set to zero, indicating that this is a DB2 view. This indication may generate erroneous
results if an application depends on the value stored in this column. A valid table ID is
not available in the Teradata RDBMS for this column.
EDPROC Set to blank, indicating that an edit procedure does not exist for this table. The Teradata
RDBMS does not support edit procedures.
VALPROC Set to blank, indicating that a validation procedure does not exist for this table. The
Teradata RDBMS does not support validation procedures.
CLUSTERTYPE Set to blank and not used in DB2 or in the Teradata RDBMS.
CLUSTERRID Set to zero and not used in DB2 or in the Teradata RDBMS.
CARD Set to -1, indicating that statistics have not been collected on this table.
NPAGES Set to -1, indicating that statistics have not been collected on this table.
PCTPAGES Set to -1, indicating that statistics have not been collected on this table.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
PARENTS Set to zero. Parent relationship information is not available on the Teradata RDBMS.
CHILDREN Set to zero. Child relationship information is not available on the Teradata RDBMS.
KEYCOLUMNS Set to zero, indicating that a DB2 primary key does not exist.
RECLENGTH Set to 32000, the largest possible record length that can be returned from the Teradata
RDBMS. RECLENGTH does not reflect the actual record length. If an application uses
this information to allocate buffer space, excess memory may be used. If the application
depends on this value to be correct, the application may not function properly.
STATUS Set to blank, indicating that a primary key does not exist.
KEYOBID Set to zero, indicating that a link to a primary key or index does not exist.
LABEL The same as the REMARKS column because the Teradata RDBMS stores only one
comment per table. The DB2 length of 30 characters is expanded to a length of 254, since
the table comment for the Teradata RDBMS is much longer than the label allowed in DB2.
CHECKFLAG Set to blanks. The table does not contain rows that violate referential constraints.
DATACAPTURE The value of the DATA CAPTURE option for tables (Y or blank)
RBA2 The log RBA when the tables were last altered
SYSIBM .SYSTABLESPACE
This view emulates the SYSIBM.SYSTABLESPACE table. The table contains a
row for the DSNDB04 table space. The following table describes
SYSIBM.SYSTABLESPACE.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
CLOSERULE Are data sets closed when table space is not used? Y
IBMREQD Does the row come from the basic machine-readable tape? N
CREATEDBY Primary authorization ID of user who created the table space SYSIBM
SYSIBM .SYSUSERAUTH
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished only to support DB2
application programs that may interrogate for DB2 system privileges. The
Teradata RDBMS does not support system privileges held by users, so zero
rows are always returned from any query. The following table describes
SYSIBM.SYSUSERAUTH.
SYSIBM .SYSVIEWDEP
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished only to support DB2
application programs that may interrogate for the dependencies of views on
tables and other views. Teradata SQL does not support this table, so zero rows
are always returned from any query. The following table describes
SYSIBM.SYSVIEWDEP.
IBM Name IBM Type Teradata RDBMS Table Teradata RDBMS Name Teradata RDBMS Type
SYSIBM.SYSVIEWS
This view contains data from the DBC.TVM catalog table to emulate the
SYSIBM.SYSVIEWS table. The table contains one or more rows for each view.
The following table describes SYSIBM.SYSVIEWS.
Teradata
IBM Name IBM Type Teradata RDBMS Name Teradata RDBMS Type
RDBMS Table
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
NAME View name. Field length of eight is expanded to 31 to accommodate the longer names
in Teradata SQL.
CHECK Set to N. Indicates CHECK option of the DB2 CREATE VIEW statement not used
IBMREQD Set to N, indicating the row does not come from the basic machine-readable tape.
TEXT Set to ?. Text portion not supported by the Teradata SQL environment.
SYSIBM.SYSVLTREE
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished only to support DB2
application programs that may interrogate SYSIBM.SYSVLTREE. The Teradata
RDBMS does not support parse trees, so zero rows are always returned from
any query. The following table describes SYSIBM.SYSVLTREE.
SYSIBM .SYSVOLUMES
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in DB2. This view is furnished solely to properly support
DB2 application programs that may interrogate for storage group volumes. The
Teradata RDBMS does not support storage groups, so zero rows are always
returned from any query. The following table describes
SYSIBM.SYSVOLUMES.
SYSIBM.SYSVTREE
This view contains data from the DBC.TVM catalog table to emulate the
SYSIBM.SYSVTREE table. For each view, the table contains one or more rows,
with the parse tree of the view. The following table describes
SYSIBM.SYSVTREE.
The following table explains how each column is supported and how its value
may vary from the expected DB2 value.
NAME View name. Field length of eight is expanded to 31 to accommodate the longer names
in Teradata SQL.
TOTLEN Total length of parse tree; set to 0. Parse trees are not defined in the Teradata SQL
environment.
IBMREQD Set to N, indicating that the row does not come from the basic machine-readable tape.
VTREE Set to blanks. Parse trees are not defined in the Teradata SQL environment.
SYSTEM.SYSCOLUMNS Columns
SYSTEM.SYSINDEXES Indexes
SYSTEM.SYSACCESS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for tables containing
SQL/DS access modules. The Teradata RDBMS does not support access
modules. The following table describes SYSTEM.SYSACCESS.
SYSTEM .SYSCATALOG
This view joins data from the DBC.DBASE and DBC.TVM catalog tables to
emulate the SYSTEM.SYSCATALOG table. Each row of the view defines one
table or view. The following table describes SYSTEM.SYSCATALOG.
CREATOR The userid under which the table or view was created. The SQL/DS length of
eight is expanded to a length of 31 to accommodate the longer userid names
available in Teradata SQL.
TABLETYPE Whether the description applies to a real table (R) or a view (V). The value is
obtained from TVM.TABLEKIND. The Teradata RDBMS value T (table) is
converted to R. The type for a view (V) remains the same.
DBSPACENO The Teradata RDBMS userid number under which the table or view was created.
The userid number is calculated from the 4-byte field DBASE.DATABASEID.
DBSPACENAME The Teradata RDBMS userid under which the table or view was created. The
SQL/DS length of 18 is expanded to a length of 31 to accommodate the longer
database names available in Teradata SQL.
TABID The table id of the Teradata RDBMS table. This column is not converted from 4-
byte to SMALLINT and is truncated by the Teradata RDBMS, so it may reflect
erroneous values.
CLUSTERTYPE Set to D, indicating the table is clustered by default rules. The Teradata RDBMS
does automatic clustering, so this field is not relevant to it.
CLUSTERROW Set to zero, indicating that clustering statistics have not been collected on this
table.
AVGROWLEN Set to -1, indicating that statistics have not been collected on this table.
ROWCOUNT Set to -1, indicating that statistics have not been collected on this table.
NPAGES Set to -1, indicating that statistics have not been collected on this table.
PCTPAGES Set to -1, indicating that statistics have not been collected on this table.
SYSTEM .SYSCHARSETS
The rows in table SYSTEM.SYSCHARSETS contain information about various
character sets. The following table describes SYSTEM.SYSCHARSETS.
NAME The name that identifies the character set. NAME is usually the name of the
character set itself.
SYSTEM .SYSCOLAUTH
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for SQL/DS column
authorizations. The Teradata RDBMS does not support column authorizations,
so zero rows are always returned from any query. The following table describes
SYSTEM.SYSCOLAUTH.
SYSTEM .SYSCOLUMNS
This view joins data from the DBC.DBASE, DBC.TVM, and DBC.TVFIELDS
catalog tables to emulate the SYSTEM.SYSCOLUMNS table. Each row defines
one column from a table or view. SYSTEM.SYSCOLUMNS also uses the
auxiliary table SYSAPI.DATATYPES to convert Teradata RDBMS column types
to SQL/DS column types. The following table describes
SYSTEM.SYSCOLUMNS.
TNAME The table name containing the column. The SQL/DS length of 18 is expanded to 31
to accommodate the longer table names available in Teradata SQL.
CREATOR The userid under which the table or view was created. The SQL/DS length of 8 is
expanded to 31 to accommodate the longer database names available in Teradata
SQL.
COLCOUNT Set to -1, indicating that statistics have not been gathered. Teradata RDBMS
statistics are not relevant to SQL/DS use.
HIGH2KEY Set to blank, indicating no HIGH2KEY information. The Teradata RDBMS does not
have relevant key range information.
LOW2KEY Set to blank, indicating no LOW2KEY information. The Teradata RDBMS does not
have relevant key range information.
AVGCOLLEN Set to -1, indicating that statistics have not been gathered. Teradata RDBMS
statistics are not relevant to SQL/DS use.
ORDERFIELD Set to N, indicating that the field is not used for physical clustering. The Teradata
RDBMS has no equivalent to physical clustering (all tables are automatically
clustered by distributing rows to multiple AMPs).
SYSTEM .SYSDBSPACES
This view retrieves data from the DBC.DBASE catalog table to emulate the
SYSTEM.SYSDBSPACES table. Each row contains information about each
SQL/DS DBSPACE. The following table describes SYSTEM.SYSDBSPACES.
The following table explains how each column is supported and how its value
may vary from the expected SQL/DS value.
DBSPACENO Internal number assigned by SQL/DS. Not defined in Teradata SQL; therefore, a
number is derived from DBC.DBASE DATABASEID.
FREEPCT Percentage of space on each page to be kept free when rows are inserted; set to 15.
SYSTEM.SYSDROP
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for SQL/DS objects to be
dropped. The following table describes SYSTEM.SYSDROP.
SYSTEM .SYSINDEXES
This view retrieves data from the DBC.DBASE, DBC.TVM, and DBC.INDEXES
catalog tables to emulate the SYSTEM.SYSINDEXES table. The view contains a
row for every index. The following table describes SYSTEM.SYSINDEXES.
The following table explains how each column is supported and how its value
may vary from the expected SQL/DS value.
INAME The Teradata RDBMS does not support named indexes, so index name is derived from
the DBC.INDEXES TABLEID and DBC.INDEXES INDEXNUMBER.
KEYLEN Average length of key field; not supported by Teradata SQL. Set to 0.
RELEASE Whether the index was created before or after the installation of SQL/DS V3R3.
SYSTEM .SYSKEYCOLS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for SQL/DS key
composition. The following table describes SYSTEM.SYSKEYCOLS.
SYSTEM .SYSOPTIONS
TS/API uses this table to build a set of values that corresponds to the SQL/DS
installation options. These options are built at installation time. The following
table describes SYSTEM.SYSOPTIONS.
The following table explains how each column is supported and how its value
may vary from the expected SQL/DS value.
SYSTEM .SYSPROGAUTH
This view retrieves data from the DBC.DBASE, DBC.ACCESSRIGHTS, and
DBC.TVM catalog tables to emulate the SYSTEM.SYSPROGAUTH table. The
view contains user privileges on macros. The following table describes
SYSTEM.SYSPROGAUTH.
The following table explains how each column is supported and how its value
may vary from the expected SQL/DS value.
GRANTOR Userid of person who granted run privilege. The SQL/DS length of eight is expanded to 31
to accommodate the longer userid names available in Teradata SQL.
CREATOR Userid of person who preprocessed the macro. The SQL/DS length of eight is expanded to 31
to accommodate the longer userid names available in Teradata SQL.
PROGNAME Name of macro that may be run by the grantee. The SQL/DS length of eight is expanded to
31 to accommodate the longer userid names available in Teradata SQL.
SYSTEM .SYSSYNONYMS
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for SQL/DS synonyms.
Since the Teradata RDBMS does not support synonyms, zero rows are always
returned from any query of this table. The following table describes
SYSTEM.SYSSYNONYMS.
SYSTEM .SYSTABAUTH
This view joins data from the DBC.DBASE, DBC.TVM, and
DBC.ACCESSRIGHTS catalog tables to emulate the SYSTEM.SYSTABAUTH
table. The following table describes SYSTEM.SYSTABAUTH.
GRANTOR The Teradata RDBMS user who granted an access right. The SQL/DS length of eight is
expanded to 31 to accommodate the longer userid names available in Teradata SQL.
GRANTEE The Teradata RDBMS user who was granted an access right. The SQL/DS length of eight
is expanded to 31 to accommodate the longer userid names available in Teradata SQL.
GRANTEETYPE Set to blank reflecting that the grantee is a user. The Teradata RDBMS cannot grant access
rights to programs, so only blank is valid.
SCREATOR The Teradata RDBMS userid who created the table or view on which rights have been
granted. The SQL/DS length of eight is expanded to 31 to accommodate the longer userids
available in Teradata SQL.
STNAME The name of the table or view on which rights have been granted. The SQL/DS length of
18 is expanded to 31 to accommodate the longer table names available in Teradata SQL.
TCREATOR The same value as SCREATOR. This value is not valid for views, since the Teradata
RDBMS provides information only about the rights to the view itself. Information about
the underlying tables is not available. Like SCREATOR, this column expanded to 31
characters.
TTNAME The same value as STNAME. This value is not valid for views, since the Teradata RDBMS
provides information only about the rights to the view itself. Information about the
underlying tables is not available. Like STNAME, this column is expanded to 31
characters.
TIMESTAMP Set to ?, indicating that no timestamp is available. This column is generally not used by
users or application programs.
UPDATECOLS Set to blank, indicating that any update privileges apply equally to all columns of a table.
SELECTAUTH Whether GRANTEE can select rows from a table or view: blank = No Privilege Y=
Privilege
INSERTAUTH Whether GRANTEE can insert rows into a table or view: blank = No Privilege Y=
Privilege
UPDATEAUTH Whether GRANTEE can update rows in a table or view: blank = No Privilege Y=
Privilege
DELETEAUTH Whether GRANTEE can delete rows from a table or view: blank = No Privilege Y=
Privilege
SYSTEM.SYSUSAGE
This is a view of the empty table, SYSAPI.SYSDUMMY. The columns are
described exactly as in SQL/DS. This view is furnished only to support
SQL/DS application programs that may interrogate for dependencies of
SQL/DS objects. The following table describes SYSTEM.SYSUSAGE.
SYSTEM .SYSUSERAUTH
This view retrieves data from the DBC.DBASE catalog table to emulate the
SYSTEM.SYSUSERAUTH table. The view denotes special privileges held by
users. The following table describes SYSTEM.SYSUSERAUTH.
The following table describes how each column is supported and how its value
may vary from the expected SQL/DS value.
NAME Userid. The SQL/DS length of eight is expanded to 31 to accommodate the longer userids
available in Teradata SQL.
AUTHOR Set to NAME. The SQL/DS length of eight is expanded to 31 to accommodate the longer
userids available in Teradata SQL.
SYSTEM.SYSVIEWS
This view retrieves data from the DBC.DBASE and DBC.TVM catalog tables to
emulate the SYSTEM.SYSVIEWS table. The view contains the definitions of
views. The following table describes SYSTEM.SYSVIEWS.
The following table explains how each column is supported and how its value
may vary from the expected SQL/DS value.
VCREATOR The userid of the person who created the view. The SQL/DS length of eight is expanded to 31
to accommodate the longer userids available in Teradata SQL.
VIEWMAT Indicates whether a view references another view, resulting in view materialization.
VIEWCHECK Indicates whether the view was created with the WITH CHECK OPTION clause.
Call Attach Facility Software that allows application programs to connect to and
use either the DB2 or Teradata RDBMS.
channel The means by which a central processor is attached to peripheral units;
the path by which data is transferred between the mainframe host and the
Teradata RDBMS hardware platform.
client A system that can execute application programs that access and
manipulate data in the Teradata RDBMS.
Customer Information Control System (CICS) An IBM monitor program for
application programs that are optimized for real-time user interaction. CICS
runs under the MVS operating system.
cursor The mechanism in SQL that moves through a multi-row response to a
SELECT or other data-returning statement. The cursor can be considered as
pointing to a current row of data.
cursor isolation One of two levels of locking for a cursor. Cursor isolation levels
are repeatable read and cursor stability.
cursor stability A level of cursor isolation used by DB2 and SQL/DS that ensures
that a transaction acquires a read lock on data when it obtains addressability to
the data. The read lock is relinquished when the transaction relinquishes its
addressability to the data if the transaction has not performed any updates or
deletions. If the transaction performs any updates or deletions, the read lock is
automatically upgraded to a write lock and relinquished at end-of-transaction
time.
database In Teradata SQL, a related set of tables that share a common space
allocation and owner.
database computer A database computing system, such as the NCR DBC/1012 or the
NCR Model 3600, 3550 or 5100.
database computing system A complete hardware/software system that
provides all of the functions of a traditional database management system and
more: a non-procedural, user-friendly query language; fault-tolerant operation
with no single point of failure; multiuser access; and interactive and batch
environments.
database management system (DBMS) Computer procedures that permit the
database to be maintained independently of application programs. A database
management system provides services for data definition, data manipulation,
and data integrity.
database server A hardware/software system that processes requests from
users (clients) of a DBMS.
data integrity Data preserved in its whole state without accidental or intentional
destruction or modification.
DBMS See database management system.
DBRM Database request module. A data set member created by the DB2
precompiler that contains information regarding SQL statements. DBRMs are
used in the bind process.
Data Base 2 (DB2) IBMs relational database management system running under
MVS.
DB2 Plan A usable control structure containing access paths to data and some
access authorization that is derived from output from a precompiler.
directive A TS/API command.
dynamic SQL SQL statements that are prepared and executed while the
application program is running. The SQL source is contained in client language
variables rather than being coded in the application program.
embedded SQL All SQL statements that are contained in the application program.
Embedded SQL can be either static or dynamic.
local area network (LAN) A means of connecting workstations that allows them
to communicate with one another. The LAN is usually confined to a limited
area, such as a building.
SAS System A software system, developed and marketed by SAS Institute, Inc.,
that offers capabilities for data access, statistical analysis, project management,
financial analysis, graphical data analysis, and application development.
SQLCODE The field in the SQLCA that contains a return code following
completion of a database request.
SQLERRM The field in the SQLCA that contains error message text related to
the corresponding SQLCODE following completion of a database request.
Structured Query Language/Data System (SQL/DS) IBMs relational database
management system running under VM/CMS (and VSE).
SQL/DS Access Module A file within an SQL/DS database containing code for the
SQL commands embedded in the application program. When the application
program executes, the module is accessed. This file is created as a result of
submitting the application code to an SQL/DS preprocessor.
Static SQL SQL statements that are coded within an application program and
prepared via a precompiler before program execution. The precompiler
Teradata SQL The Teradata Structured Query Language (Teradata SQL) for use
with the Teradata RDBMS.
Teradata SQL Extensions SQL syntax capabilities that extend beyond normal
ANSI, DB2, and SQL/DS syntax and that are supported only on the Teradata
RDBMS.
Time Sharing Option (TSO) A multi-user monitor subsystem that runs under the
MVS operating system.
Transparency Series/Application Program Interface (TS/API) An application program
interface that allows you to access relational databases stored on the Teradata
RDBMS.
Virtual Machine (VM ) One of the primary operating systems (or system control
programs) for medium and large IBM computers.