Tuesday 28 February 2012

Teradata Utilites

Fast Export(script)
===========================

This is the sample fast export script which can export huge volume of data from tables or views to a client system for meaningful use. The notion of this concept is to move data out of teradata.

.logtable DB.error_table;

.logon tdpid/username,password;
.begin export
          sessions 12;
.export outfile file_name FORMAT FASTLOAD MODE RECORD;
select Column_1
         Column_2,
         Column_3,
         Column_4,
         Column_5,
         Column_6
 from db.TableName where Column_1='----';
.end export;
.logoff;
--------------------------------------------------------------------------------------------
Fast export which generates out file and Multi Load script simultaneously.
===================================================
.logtable DB.error_table;

.logon tdpid/username,password;
.begin export
       sessions 12;
.export outfile abc.txt MLSCRIPT pqr.txt;
       select Column_1
         Column_2,
         Column_3,
         Column_4,
         Column_5,
         Column_6
 from db.TableName where Column_1='----';

.end export;
.logoff;

--------------------------------------------------------------------------------------