Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 10 Jul 2004 @ 00:25:46 GMT


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


Subj:   Re: Windows-based Fast Export Script
 
From:   Ganga Palakattil

I tried the following two scripts. But the output is like this:

      3186139 ,[1] 73 ,
     ________________________________

      1623 ,
     ________________________________

      6208 , 0

      2536513 ,[1] 17 ,
     ________________________________

      231 ,
     ________________________________

      6246 , 1

      6464892 , 6 ,[1] 76 ,
     ________________________________

      6664 , 1

      5036796 , 1 , 2 ,
     ________________________________

      6246 , 1

      4072568 ,
     ________________________________

      283 ,
     ________________________________

      3208 ,
     ________________________________

      6010 , 0

I need to get rid of the 'Small Square followed by space' from the beginning and end of every field.

Any idea how to fix this? I need to load it directly to SQL Server using an automated Process.

Script1:

     .LOGTABLE obc_load.felog;
     .LOGON ServerName/userid,password;
     .BEGIN EXPORT
         SESSIONS 20;
     .EXPORT MODE RECORD OUTFILE C:\FASTEXPORT\OUT_FILES\LERG.TXT FORMAT TEXT;

     SEL NPANXXX          (FORMAT '9999999999') (CHAR(10))
           , ','
           , OWNER_MARKET_ID  (FORMAT '9999999999')  (CHAR(10))
           , ','
           , OWNER_CARRIER_ID (FORMAT '9999999999')  (CHAR(10))
           , ','
           , OCN              (CHAR(4))
           , ','
           , MARKET_TYPE      (FORMAT '9999999999')  (CHAR(10))

           FROM DBNAME.TableName;

     .END EXPORT;
     .LOGOFF;

Script2

     .LOGTABLE DBNAME.felog;
     .LOGON ServerName/userid,password;
     .BEGIN EXPORT
         SESSIONS 20;

     .EXPORT MODE RECORD OUTFILE C:\FASTEXPORT\OUT_FILES\LERG.TXT FORMAT TEXT;

     SEL   CAST(NPANXXX AS VARCHAR(20)), ',',
           CAST(OWNER_MARKET_ID AS VARCHAR(10)), ',',
           CAST(OWNER_CARRIER_ID AS VARCHAR(10)), ',',
           CAST(OCN AS VARCHAR(10)), ',',
           CAST(MARKET_TYPE  AS VARCHAR(10))
           FROM DBNAME.TableName;

     .END EXPORT;
     .LOGOFF;

Other than 'OCN' all columns are numeric.


Thanks

Ganga



     
  <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