SQL Programming Manual for TAL
NonStop SQL Statements and Directives
HP NonStop SQL Programming Manual for TAL—527887-001
3-23
INVOKE
•
Use TACL DEFINEs only for table or view names; do not use them for structure
names.
Table 3-2 shows the override data type mapping generated by the INVOKE directive.
Defining the Structure Template
The INVOKE directive defines a structure template with a default name as the table
name plus the suffix ^TYPE. For example, the following INVOKE directive defines a
structure template for the EMPLOYEE table:
EXEC SQL INVOKE employee;
The CREATE TABLE statement that defines the table is:
CREATE TABLE employee
(emp_id NUMERIC(4) NOT NULL,
dept_num NUMERIC(6) NOT NULL
);
The INVOKE directive causes the TAL compiler to generate the following structure
template:
! Record Definition for table \SYS.$DB.PERSNL.EMPLOYEE
! Definition current at 14:54:18 - 09/27/89
STRUCT employee^type (*);
BEGIN
INT emp^id;
INT(32) dept^num;
END;
Table 3-2. INVOKE Directive Override Data Type Mapping
SQL Data Type
Host Variable Description Generated by the INVOKE
Directive
SMALLINT UNSIGNED INT name / SMALLINT UNSIGNED /
INTEGER UNSIGNED INT(32) name / INTEGER UNSIGNED /
NUMERIC (1 - 4, s) UNSIGNED INT name / SMALLINT UNSIGNED /
NUMERIC (5 - 9, s) UNSIGNED INT(32) name / INTEGER UNSIGNED /
DECIMAL(1) STRING name / DECIMAL(1) /
DECIMAL(1) UNSIGNED STRING name / DECIMAL(1) UNSIGNED /
DECIMAL (n) STRING name [0 : n - 1] / DECIMAL(n) /
DECIMAL (n) UNSIGNED STRING name [0 : n - 1] / DECIMAL (n) UNSIGNED /
name is the name of the host variable.
n is a positive integer that represents the length.
s is a positive integer that represents the scale of the number.