Page 1 of 1

Oracle substring /Datastage Metadata warning

Posted: Fri Aug 14, 2009 1:59 pm
by dsedi
Experts,

We are extracting data out of the Oracle Enterprise State using "User Defined SQL"
Select Substr(Ltrim(Rtrim(NAME)),1,9) as NAME
we have defined the Stage metadata column as Varchar length 9

and we are getting the following warning.
When checking operator: When binding output interface field "NAME" to field "NAME": Implicit conversion from source type "string[max=27]" to result type "string[max=9]": Possible truncation of variable length string.

We are not sure where its getting calculated the source type with length 27(9 multiply by 3)

There is another Oracle Stage too having the same issue
Select Substr(Ltrim(Rtrim(IA.ATTRIBUTE1)),1,1)||Substr(Ltrim(Rtrim(IA.ATTRIBUTE2)),1,5) AS CODE
and we have defined the Stage metadata column as Varchar length 6
The warning is

When binding output interface field "CODE" to field "CODE": Implicit conversion from source type "string[max=18]" to result type "string[max=6]": Possible truncation of variable length string.

Any advice on this? Thanks in advance!

Posted: Fri Aug 14, 2009 4:03 pm
by Sainath.Srinivasan
What is the length of column defined in the stage ?

Posted: Fri Aug 14, 2009 4:51 pm
by chulett
Because you are doing the substring in the query, DS has no idea and so looks at the metadata and issues the 'possible truncation' warning. You should be able to select the entire field and then do the substring in the derivation downstream to avoid that message. I do believe.

Posted: Tue Aug 18, 2009 3:20 pm
by dsedi
Thanks Sai,Craig,

Just Substrb instead of substr solved this issue.