Page 1 of 1

Conversion from numeric to string in a job

Posted: Wed Jun 27, 2007 2:42 pm
by bgs_vb
Hi,

I need to convert NUMERIC(10) datatype to NVARCHAR(10) in Parallel Job from desinger. when i change the type and execute it throws error.

is there a way to do it.

Thanks,
Vindy

Posted: Wed Jun 27, 2007 3:05 pm
by chulett
What did you try and what error did you get?

Posted: Wed Jun 27, 2007 3:14 pm
by bgs_vb
I changed the datatype in designer from numeric to nvarchar and i try to run the job i get the following:


Error when checking operator: When binding output schema variable "resRec": When binding output interface field "NOMINATION_KEY" to field "NOMINATION_KEY": Implicit conversion from source type "decimal[10,0]" to result type "ustring[max=10]": Not enough room in ustring for decimal[10,0].

What should i do to convert type in desinger.

Thanks,
Vindy

Posted: Wed Jun 27, 2007 3:15 pm
by bgs_vb
I changed the datatype in designer from numeric to nvarchar and i try to run the job i get the following:


Error when checking operator: When binding output schema variable "resRec": When binding output interface field "NOMINATION_KEY" to field "NOMINATION_KEY": Implicit conversion from source type "decimal[10,0]" to result type "ustring[max=10]": Not enough room in ustring for decimal[10,0].

What should i do to convert type in desinger.

Thanks,
Vindy

Posted: Wed Jun 27, 2007 3:43 pm
by ray.wurlod
Let me clarify. You simply changed the data type - you did not use any explicit data type conversion function. Is this correct?

Posted: Wed Jun 27, 2007 3:54 pm
by bgs_vb
yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.

Posted: Wed Jun 27, 2007 7:08 pm
by ArndW
That is not the correct way to do this, even though it is allowed. There is a modify stage which is designed to do conversions such as this.

Posted: Thu Jun 28, 2007 7:20 am
by DSguru2B
Or even the transformer stage which has Parallel Job Functions, specifically conversion functions, to perform this.

Posted: Thu Jun 28, 2007 10:32 am
by karrisuresh
Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.

u can do this in the following way

Posted: Thu Jun 28, 2007 10:33 am
by karrisuresh
Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.

u can do this in the following way

Posted: Thu Jun 28, 2007 10:33 am
by karrisuresh
Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.

Re: Conversion from numeric to string in a job

Posted: Thu Jun 28, 2007 10:34 am
by karrisuresh
Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:Hi,

I need to convert NUMERIC(10) datatype to NVARCHAR(10) in Parallel Job from desinger. when i change the type and execute it throws error.

is there a way to do it.

Thanks,
Vindy