on 07-23-2012 3:34 PM
Hi,
In IDT, we have join on two columns whose data type showing Varchar and Integer respectively in data foundation. we have option in dfx to edit the data type.
My question is, what will happen in above example if i change above column data type varchar to Integer ? Will it treat as Integer column when running the query??
If so, I have created one calculated column using formula like convert(Object, Intger), then what is the difference between this calculated Integer column and above Integer column(data type changed from Varchar->Integer)
Thanks,
No the Object with the Varchar datatype will be considered as Varchar and not integer since you are only applying the convert function only on a Join and not the actual column. You SQL would come out as below
Object1 Varchar from Table x
Object 2 Integer from Table y
Select Object1,
Object 2
From x,y
Where Convert(x.Object1,Integer) = y.Object2
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tauseef,
Yes, I agree with above SQL when we join with calculated column. But what will happen when you edit the actual column data type to Integer? and in which scenario we will edit datatype in data foundation level?
I will give one more example.. We have one Key fig which don't have any values and it is showing its datatype as varchar in datafoundation. So I changed that KF datatype to Integer, changed in business layer as well to Numeric. (Its SQL definition is sum(table.KF)). When we execute the query it is displaying error message that sum function can only be applied to Integer. So it is taking actual data type (Varchar) and ignoring that changed data type (Integer) in data foundation level.
Thanks,
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.