Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 18 Oct 2003 @ 03:43:14 GMT


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


Subj:   Re: Fastload and nullif
 
From:   Meade, Cornelius

I interpreted the original question which started this thread as asking if one could check against more than one value in a single column as denoting a possible NULL condition in a fastload control script. Below is an snippet/example of how you could do this in a multiload control script. I do not think this type of thing can be done natively in a fastload control script as fastload is a bit more limited in data transformation capabilities than multiload but if anyone knows differently, please speak up.....

.LAYOUT TEST_TABLE_WRK_INFILE ;
/*Start*/
   .FIELD DATE_VALUE1                     * char(8) ;             /* 1*/
   .FIELD DATE_VALUE2                     * char(8) ;             /* 9*/

.DML LABEL INSERTS ;
   INSERT INTO TEST_TABLE_WRK
     (DATE_VALUE1
     ,DATE_VALUE2 )
   VALUES
     (CASE WHEN (:DATE_VALUE1 = '        ')
             OR (:DATE_VALUE1 = '00000000')
             OR (:DATE_VALUE1 = '       0')
             OR (:DATE_VALUE1 = 'N/A     ')
           THEN NULL
           ELSE :DATE_VALUE1
      END
     ,CASE WHEN (:DATE_VALUE2 = '        ')
             OR (:DATE_VALUE2 = '00000000')
             OR (:DATE_VALUE2 = '       0')
             OR (:DATE_VALUE2 = 'N/A     ')
           THEN NULL
           ELSE :DATE_VALUE2
      END) ;


     
  <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