PROVE IT !!If you know it then PROVE IT !! Skill Proficiency Test

Error while casting to decimal !

Trying to cast a column into decimal but its failing with the error

1
sel cast(a25 as decimal(38,2)) from TempUpdate

SELECT Failed. 2617: Overflow occurred computing an expression involving TempUpdate. a 25
So it means the column is having larger value than an decimal can hold rite?

Having said that the below statement runs fine

1
sel cast(cast(a25 as varchar(100)) as decimal(38,2)) from TempUpdate

so is casting to number and integer

1
2
sel cast(a25 as integer) from TempUpdate;
sel cast(a25 as number) from TempUpdate;