15.10 - EMPLOYEE Table Source Code - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

To create the new EMPLOYEE table, follow the next example. This code resides in the LABSBTEQ file. Remember to substitute the userid and password appropriate to your installation.

.echoreq off
.logon tdpid/userid,password
DROP TABLE EMPLOYEE;
CREATE TABLE EMPLOYEE, FALLBACK,
                      NO BEFORE JOURNAL,
                      NO AFTER JOURNAL
(EMPLOYEE_NUMBER           INTEGER,
 MANAGER_EMPLOYEE_NUMBER   INTEGER,
 DEPARTMENT_NUMBER         INTEGER,
 JOB_CODE                  INTEGER,
 LAST_NAME                 CHAR(20)       NOT NULL,
 FIRST_NAME                VARCHAR(30)    NOT NULL,
 HIRE_DATE                 DATE           NOT NULL,
 BIRTHDATE                 DATE           NOT NULL,
 SALARY_AMOUNT             DECIMAL(10,2)  NOT NULL)
 UNIQUE PRIMARY INDEX(EMPLOYEE_NUMBER);
.import data dd=labdat
.repeat *
 USING   FIELD1 (INT),
         FIELD2 (INT),
         FIELD3 (INT),
         FIELD4 (INT),
         FIELD5 (CHAR(20)),
         FIELD6 (VARCHAR(30)),
         FIELD7 (INT),
         FIELD8 (INT),
         FIELD9 (DEC (10,2))
INSERT INTO EMPLOYEE VALUES (:FIELD1, :FIELD2, :FIELD3,
      :FIELD4, :FIELD5, :FIELD6, :FIELD7, :FIELD8,
      :FIELD9);
.SIDETITLES ON
.FOLDLINE ON ALL
.SKIPDOUBLE ON 1
 SELECT * FROM EMPLOYEE ORDER BY 1;