Example: Load a table using SQL
inserter
|
DEFINE JOB LOAD_EMPLOYEE_TABLE_FROM_FILE
DESCRIPTION 'Load file using inserter operator'
(
/*****************************/
DEFINE SCHEMA EMPLOYEE_SCHEMA
DESCRIPTION 'SAMPLE EMPLOYEE SCHEMA'
(
EMP_ID VARCHAR(10),
EMP_NAME VARCHAR(30)
);
/*****************************/
DEFINE OPERATOR FILE_READER()
DESCRIPTION 'TERADATA PARALLEL TRANSPORTER DATA CONNECTOR
OPERATOR'
TYPE DATACONNECTOR PRODUCER
SCHEMA EMPLOYEE_SCHEMA
ATTRIBUTES
(
VARCHAR PrivateLogName
= 'file_reader_private.log',
VARCHAR FileName
= 'input_delimited_file.txt',
VARCHAR IndicatorMode
= 'N',
VARCHAR OpenMode
= 'Read',
VARCHAR Format
= 'Delimited'
);
/*****************************/
DEFINE OPERATOR TEST_INSERTER
DESCRIPTION 'Teradata PT INSERTER OPERATOR'
TYPE INSERTER
SCHEMA *
ATTRIBUTES
(
VARCHAR TdpId = 'Prd.Database.com',
VARCHAR UserName = sukul,
VARCHAR UserPassword = ‘mysillypwd’,
VARCHAR PrivateLogName = 'SQL_inserter_log'
);
/*****************************/
STEP export_to_file
(
APPLY ('INSERT INTO FINANCE.SOURCE_EMP_TABLE VALUES
(:EMP_ID,:EMP_NAME);')
TO OPERATOR (TEST_INSERTER() )
SELECT EMP_ID,EMP_NAME FROM OPERATOR (FILE_READER());
);
);
|
Blog Archive
-
►
2012
(22)
- ► January 2012 (21)
- ► February 2012 (1)
-
▼
2013
(119)
- ► February 2013 (2)
- ► March 2013 (28)
- ► April 2013 (48)
- ► September 2013 (16)
- ► October 2013 (3)
-
▼
November 2013
(13)
- 7.1 Teradata Parallel Transporter Export Operator ...
- 7.2 Teradata Parallel Transporter - Export Operato...
- 7.3 Teradata Parallel Transporter - Export Operato...
- 8.1 Teradata Parallel Transporter - SQL selector O...
- 8.2 Teradata Parallel Transporter - SQL selector -...
- 8.3 Teradata Parallel Transporter - SQL selector o...
- 9.1 Teradata Parallel Transporter - Load Operator ...
- 9.2 Teradata Parallel Transporter - Load Operator ...
- 9.3 Teradata Parallel Transporter - Load Operator ...
- 10.1 Teradata Parallel Transporter - SQL inserter ...
- 10.2 Teradata Parallel Transporter - SQL inserter ...
- 11.1 Teradata Parallel Transporter - Stream Operat...
- 11.2 Teradata Parallel Transporter - Stream Operat...
Saturday, 16 November 2013
10.2 Teradata Parallel Transporter - SQL inserter example
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment