Create a Source and Target Table
The following is the job script you will be running:
DEFINE JOB qsetup3
(
APPLY
('DROP TABLE SOURCE_EMP_TABLE;')
,('CREATE TABLE SOURCE_EMP_TABLE(EMP_ID VARCHAR(10), EMP_NAME VARCHAR(10));')
,('INSERT INTO SOURCE_EMP_TABLE(''ID11'',''BILLY'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID12'',''JANIE'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID13'',''KRYSTAL'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID14'',''MATTHEW'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID15'',''LINDA'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID16'',''DAN'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID17'',''LAINE'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID18'',''MICHIKO'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID19'',''WILL'');')
,('INSERT INTO SOURCE_EMP_TABLE(''ID20'',''MONICA'');')
,('DROP TABLE TARGET_EMP_TABLE;')
,('DROP TABLE TARGET_EMP_TABLE_LOG;')
,('DROP TABLE TARGET_EMP_TABLE_E1;')
,('DROP TABLE TARGET_EMP_TABLE_E2;')
,('CREATE TABLE TARGET_EMP_TABLE(EMP_ID VARCHAR(10), EMP_NAME VARCHAR(10));')
,('INSERT INTO TARGET_EMP_TABLE(''ID01'',''JOHN'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID02'',''PETER'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID03'',''FRANK'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID04'',''MARY'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID05'',''ELLEN'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID06'',''MICHAEL'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID07'',''SAM'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID08'',''JONATHAN'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID09'',''MICHELLE'');')
,('INSERT INTO TARGET_EMP_TABLE(''ID10'',''ALICE'');')
TO OPERATOR ($DDL);
);
The script is saved as qsetup3.txt in the quickstart sample directory.
Note: For the purposes of this example, qsetup3 creates and populates both the source and target tables.
To run the job script that creates a target table, execute the following Teradata PT command in the command window:
tbuild -f qsetup3.txt -v jobvars3.txt -j qsetup3
where:
This tbuild option... |
Takes the following argument... |
-f |
Name of the script to be run: qsetup3.txt |
-v |
Name of the job variables file: jobvars3.txt This is the job variables file you have edited. |
-j |
Name of the job: qsetup3 |
RESULT: Once you have run the tbuild command creating the source and target table, you will see output on the console confirming that the table has been created. The console output may contain a DBS 3807 warning. You can ignore this message. For more information, see the ErrorList operator attribute in the DDL Operator chapter of the Teradata Parallel Transporter Reference.