Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 01 Sep 2004 @ 11:46:26 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: FAST EXPORT Replace function
 
From:   Coffing Christopher L

Sree

I see 2 options for you instead of trying to perform a REPLACE on the data set.

Option 1: Change the delimiter of FASTEXPORT to something that works for your data. The issue that you run into with FASTEXPORT is that it creates a file that is expected to go back into Teradata. It is no easy task to get a clean text file from FASTEXPORT without writing and OUTMOD. (If anyone has a way to get a clean text file from fastexport please share.)

Option 2: If the data set that you are extracting from Teradata is less than 500,000 rows, maybe a million rows if you want to push it... Use the latest version of BTEQ I believe it is 08.02.01.00 or higher to extract your data. It is less of a burden on your system than FASTEXPORT but make sure you do some timings and monitor the job to determine if this fits in your world.

Here is a BTEQ script that will create a TAB delimited file.

     .sessions 32
     /*CHANGE THE USERNAME AND PASSWORD */
     .logon TDPID/USERNAME,PASSWORD;

     .export reset

      /*THIS ERASES THE FILE BEFORE CREATING A NEW ONE */
     .os erase D:\FILE DESTINATION\FILENAME.TXT

     /*THIS IS THE EXPORT FILENAME AND LOCATION */
     .export file = D:\FILE DESTINATION\FILENAME.TXT

     .set titledashes off
     .set heading ''
     .set width 4000
     .set format off

     /* TAB DELIMITED. CHANGE TO DIFFERENT DELIMITER AS DESIRED */
     .set separator '        '

     /*====================================*/

      PLACE SELECT STATEMENT HERE ENDING WITH ;

     /*====================================*/

     .export reset

     .logoff;
     .exit;

There is no error handling so please tailor to your environment. You can play with the number of .sessions to determine what works best for your environment and you can also change the .set separator to something else.

We have users that are allowed to extract data from our warehouse and this is a simple script to give them so they do not use MS Access or SQL Assistant to extract 100's of 1000's of rows at a time using ODBC...

Let me know if this helps...


Best Regards

Chris Coffing
AFKS O&M Lead Teradata DBA
Certified Teradata Master



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023