Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Tue, 21 Aug 2012 @ 16:04:01 GMT


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


Subj:   Re: Separator in Mload
 
From:   Barry Hull

If the '"' symbol is always there, you can code this in the INSERT statement:

     fieldx = SUBSTR(:input_fieldx, 2, CHARACTER_LENGTH(:input_fieldx) - 2)

Otherwise, you'll need to use a CASE:

     fieldx = CASE WHEN SUBSTR(:input_fieldx, 1, 1) = '"' THEN SUBSTR(:input_fieldx, 2,
     CHARACTER_LENGTH(:input_fieldx) - 2) ELSE :input_fieldx END

You can also use TRIM, but if you have '"' in your actual data, then that will be trimmed as well if it occurs at the beginning or the end:

     fieldx = TRIM(BOTH '"' FROM :input_fieldx)

Good luck.

Barry



     
  <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: 28 Jun 2020