Page 1 of 1

What happens when varchar is mapped to char, look at the ex.

Posted: Tue Jan 13, 2009 12:14 pm
by zulfi123786
For example:

A field 'ID' is Varchar(10) and having a value "abc", if this field is directly mapped to "IP_ID" char(10) in a transformer, would it append 7 spaces to "IP_ID".

Posted: Tue Jan 13, 2009 12:16 pm
by chulett
Yes.

Posted: Tue Jan 13, 2009 12:54 pm
by Mike
A CHAR field is fixed-width. It will pad to the specified length with whatever is defined in $APT_STRING_PADCHAR. It defaults to 0x0 I think... use 0x20 to pad with spaces.

Mike

Posted: Tue Jan 13, 2009 12:58 pm
by zulfi123786
chulett wrote:Yes. ...
If i don't specify the length while reading the sequential file, even then would it do the same?

Posted: Tue Jan 13, 2009 12:59 pm
by chulett
Ah... forgot about the PADCHAR variable and the fact you can control it inside your job. So, the default is to pad with "nulls"? :?