Sushma Kudum, January 29, 2018 - 3:17 pm UTC
Hi Chris,
Thank you for prompt reply, I tried query as mentioned by you and faced below mentioned error:
ORA-01790: expression must have same datatype as corresponding expression
at the step:
SOURCE_ID FOR DEST_ID IN (amid, askid).
all these dbid,amid,askid are of type NOT NULL RAW(16 BYTE).
January 29, 2018 - 3:47 pm UTC
Raw seems fine to me:
select dbid, SOURCE_ID
from (
select hextoraw('d1') dbid, hextoraw('f1') askid, hextoraw('a1') amid
from dual
) unpivot INCLUDE NULLS (
SOURCE_ID FOR DEST_ID IN (amid, askid)
);
DBID SOURCE_ID
D1 A1
D1 F1
Sooo....
Give us a test case! i.e.
- create table
- insert into
- your query
Sushma Kudum, January 29, 2018 - 5:24 pm UTC
Thanks a lot Chris,
It worked with minor changes.
Solution is:
select dbid as DEST_ID, SOURCE_ID
from (
select 'd1' dbid,
cast('m1' as varchar2(200)) as askid,
cast('a1' as varchar2(200)) as amid
from dual
) unpivot INCLUDE NULLS (
SOURCE_ID FOR DEST_ID IN (amid, askid)
);
Regards,
Sushma