Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 11 Aug 2010 @ 11:42:59 GMT


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


Subj:   BTEQ import specified columns
 
From:   GRAHAM, Paul

Hi

I use BTEQ to import data from a csv. I usually have to import this to access to strip out the unnecessary fields, export to text, then run as this:

     .IMPORT VARTEXT '|' FILE=V:\File.txt;
     .REPEAT *
     USING
     URN (VARCHAR (15)),
     forename (VARCHAR(30)),
     surname (VARCHAR(30)),
     add1 (VARCHAR(50)),
     postcode (VARCHAR(10)),
     dob (VARCHAR(10)),
     dod (VARCHAR(10))
     INSERT INTO DATABASE.TABLE
     values
     (
     :URN,
     :forename,
     :surname,
     :add1,
     :postcode,
     :dob,
     :dod
     );
     .QUIT;

It would save time if I could import just the required fields from the original csv (which has 18 columns without headings).

I've searched the web and tried a few possibilities including:

     .IMPORT VARTEXT ',' FILE=V:\File.csv;
     .REPEAT *
     USING
     col1 (VARCHAR (15)),
     col3 (VARCHAR(30)),
     col5 (VARCHAR(30)),
     col7 (VARCHAR(50)),
     col13 (VARCHAR(10)),
     col15 (VARCHAR(10)),
     col16 (VARCHAR(10))
     INSERT INTO DATABASE.TABLE
     values
     (
     :URN,
     :forename,
     :surname,
     :add1,
     :postcode,
     :dob,
     :dod
     );
     .QUIT;

..without success. Could anyone point me in the right direction with this?


Thanks

Paul



     
  <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