Page 1 of 1

how to handle the escape code in sequential file stage

Posted: Mon Jul 04, 2011 5:34 am
by yimwai
I use a sequential stage to read a DB2 exported file .
one record only has two columns one is id (int),the other is name(char(60))
but sometime there will be a " in the second column, after exported,there will be double " in the file,one is the escape code.
so in this time how can i read the file?
if i set the column length 60,sometime it will be too short
if i set the column length longer or use type varchar,the stage will read double " in the column .

Posted: Mon Jul 04, 2011 7:34 am
by chulett
If it can 'read the double " in the column' successfully, why not simply remove them using Convert() afterwards? Or reduce it to a single occurance if that's what you need.

Posted: Mon Jul 04, 2011 3:19 pm
by ray.wurlod
Use type VarChar or set the length sufficiently longer.