WARNING:Implicit conversion from source type to result type

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

WARNING:Implicit conversion from source type to result type

Post by deepa_shenoy »

Hi,

I am getting this warning while using the Change Data Capture Stage:

CHCP_GL: When checking operator: When binding output schema variable "outputRec": When binding output interface field "source_code" to field "source_code": Implicit conversion from source type "ustring[5]" to result type "string[max=5]": Converting ustring to string using codepage ISO-8859-1.

What do I do to remove this warning. Its coming for all the columns.

Thanks in advance.

Regards,
Deepa
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Be consistent with your use of the extended property Unicode on your strings.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

Hi All,

Sorry for re-opening this topic.

I am getting these warnings:

When checking operator: When binding output interface field "AR_ADDRESS3" to field "AR_ADDRESS3": Implicit conversion from source type "ustring[max=50]"to result type "string".
When checking operator: When binding output interface field "AR_ADDRESS3" to field "AR_ADDRESS3": Conversion from source type "string" to result type "ustring[max=50]": Possible truncation of variable length string.

I have removed Unicode from the source metadata as well target metadata. I have tried giving the following at both source and target:
1. Varchar (same lengths)
2. NVarchar (same lengths)
3. Varchar + Unicode
4. NVarchar (different lengths as it said "Possible truncation")

My source is SQL Server, so I am using an ODBC Stage and my Target is a Sequential File, through a Copy Stage.

Unicode values are present in the data. How do I resolve this issue?

Thanks in advance.

Regards,
Deepa
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

If Unicode values are present in your data, why have you removed Unicode?

Your type definitions need to be the same in all three stages
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your string type, wherever it is, is unbounded. You will therefore always get these alert messages.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

Is there any solution for the alert messages to stop coming?

I have given Varchar + Unicode. No difference at all.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Give VarChar(50) - that is, data type VarChar and precision 50.

Standardize whether you have Unicode or don't have Unicode.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

I did not want to use unicode anywhere so I removed it while importing itself. But this particular column still showed Varchar(Unicode) as its SQL type. Hence, I manually removed it. None of the columns have unicode now.

In the source(SQL Server) the datatype is 'Nvarchar'.

The datatype and length given in Datastage in all the stages is Varchar 50.

The warning still persists.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

NVarChar is Unicode. Use Unicode consitently throughout, and always specify a string length. You may need to make the sizes a multiple of the number of characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

I gave NVarchar and increased the size to 5000.
The error still comes.

ODBC_Contract: When checking operator: When binding output interface field "AR_ADDRESS3" to field "AR_ADDRESS3": Implicit conversion from source type "ustring[max=50]"to result type "string".

This is at the source ODBC stage itself.
Last edited by deepa_shenoy on Tue Dec 01, 2009 11:03 pm, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Exactly the same error, referring to a length of 5? If so, you've missed one - or are looking at the wrong log.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

There are three columns which throw this warning. Currently, I have created a new job and selected only those three columns and trying all kinds of permutation and combination to get rid of the error.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please re-read my question. Then answer it. Or at the very least try to think about what I'm driving at.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply