Skip to Content
Former Member
Aug 04, 2015 at 09:36 PM

Joining 2 columns with different data types


Hi All,

I have a doubt regarding a join condition, hope anyone of you can help in resolving it

1st column (ACCNO) in the join is always 8 digit numeric value and

2nd column (UNIT) has mostly numeric values (but with different lengths) and some string values(Alphabhets)

We want to implement a case statement to do this where if the column has numeric value then the join should convert the UNIT column to 8 length and connect to ACCNO else it should be null

How to find if the implement this as a join condition (does Digits function in IDT work for this?)

To change the length of 2nd column, I'm planning on using RIGHT('00000000' || B_LEDGER.UNIT,8)

Client Data base: DB2

Universe is built on IDT 4.0 SP04 version

Thanks in advance,