Oracle substring /Datastage Metadata warning

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Oracle substring /Datastage Metadata warning

Post 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!
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

What is the length of column defined in the stage ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Post by dsedi »

Thanks Sai,Craig,

Just Substrb instead of substr solved this issue.
Post Reply