0% found this document useful (0 votes)
112 views3 pages

Lab Exercise #3 Tutorial: .Set Record Unformatted

This document provides instructions for loading source data into a target database using Fast Load scripts. It outlines steps to 1) create a source structure in the RDBMS to use as a staging area, and 2) write a Fast Load script to load the source database into the RDBMS staging area, handling errors. A sample Fast Load script is provided that defines fields, loads data from a file into a target table in batches, specifies error files, and commits changes.

Uploaded by

shanu_123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views3 pages

Lab Exercise #3 Tutorial: .Set Record Unformatted

This document provides instructions for loading source data into a target database using Fast Load scripts. It outlines steps to 1) create a source structure in the RDBMS to use as a staging area, and 2) write a Fast Load script to load the source database into the RDBMS staging area, handling errors. A sample Fast Load script is provided that defines fields, loads data from a file into a target table in batches, specifies error files, and commits changes.

Uploaded by

shanu_123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Exercise #3 Tutorial

E 1) Create the Source Structure on the RDBMS by using Query Man or BTEQ based on your analysis
of your source system. This will be your staging area.
E 2) Write Fast Load Script for loading the source database in RDBMS.Sample script is given below.
.SESSIONS 1;
.ERRLIMIT 50;

.LOGON server - name/usemame, password;


.SET RECORD UNFORMATTED

DATABASE database_name;

DROP TABLE your_table;


DROP TABLE your_table _errorl;
DROP TABLE your_table _error2;

CREATE TABLE your_table (

account id char(12),
credit_card _type_cd char(l),
transaction_amt decimal(9,2),
,transaction_type _cd char(2),
trade_dt_date char (8)

);
DEFINE
account id , (char(12))
credit_card _type_cd, (char(1))
transaction - amt, (char(1l) )
transaction_type _cd, (char(2))
trade_dt_date (char (8))
,NewLine (char(2))
FILE=c:\temp\name_of_data_file.txt;

BEGIN LOADING your_table


ERRORFILES your_table_ERRORI, your_table_ERROR2
CHECKPOINT 10000;

INSERT INTO your_table (

account_id,
credit_card _type_cd,
transaction _amt,
transaction_type _cd,
trade dt date

) V ALVES (

:account_id,
: credit- card_type _cd,
:transaction - amt,
: transaction _type_cd,
:trade dt date
);
END LOADING;
.LOGOFF;

You might also like