Page 1 of 1

Simple query

Posted: Tue Dec 18, 2007 12:45 am
by arnie_nits
hi,

I have a varchar field of lenght 11 and I need to find the characters from 6th to 9th position, in transformer stage.Plz help.

Regards
Arnab.

Posted: Tue Dec 18, 2007 12:48 am
by us1aslam1us
check string() and substring() functions.simple case will be string[6,4].

Posted: Tue Dec 18, 2007 5:06 pm
by vmcburney
In the Modify Stage you use the substring function, in the Transformer stage you treat the field as an array and simply used inputfieldname[6,4] as shown by Arnab. You can also check the length of the field first if it's not always 11 characters.

Posted: Tue Dec 18, 2007 7:30 pm
by ray.wurlod
In the Modify stage, however, counting is zero-based, so you will need to retrieve four characters beginning from position 5.