cancel
Showing results for 
Search instead for 
Did you mean: 

character set mismatch error while using cast function in IDT

Former Member
0 Kudos

Hi ,

Could you please help on this issue . I am trying to use the cast function to convert number varchar in Information design tool .

But it is throwing error message character set mismatch.

Thanks & Regards

Venkat

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184594
Active Contributor
0 Kudos

What is you syntax? Could you share it so that we may help you better?

Former Member
0 Kudos

Hi ,

I am using correct syntax and its parsing correctly at universe level but while trying to see the value its throwing character mismatch error .

At table level the column (column name as version name) data type is nvarchar . It contains the value like V0 , xyz, abc .. etc. I need display 000 instead of V0 value .

so I am using the below code to convert V0 to 000

case when version='V0' then cast('000' as varchar) else version end .

Thanks

Venkat

Former Member
0 Kudos

Make sure ou set the datatype of the object as Char before converting it

Sujit
Active Participant
0 Kudos

Are you using multiple objects / columns in the expression, in that case you will have to CAST the other related columns too, else there will be a mismatch in the datatype hence the error.

Let me know if this helps.

Sujit