Archives of the TeradataForum
Message Posted: Tue, 21 Aug 2012 @ 16:04:01 GMT
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
|