Decode Function issue
i want compare two rows in a table. so i used decode function to compare the values, whther its matched or not.
One of my table column has Long data type.
col1 - is long data type.
when i use long data type, i got below error,
is there anyway to rectify this error.
SQL Error: ORA-00932: inconsistent datatypes: expected NUMBER got LONG
00932. 00000 - "inconsistent datatypes: expected %s got %s"
Thanks in advance.
LONG columns are pretty restictive, one of the restrictions is that they cannot be used on built-in functions.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Try using the to_clob() function, and then you can also use all of the methods of dbms_lob. As in:
select dbms_lob.compare(to_clob(tab_a.mycolumn), to_clob(tab_b.mycolumn))
inner join table_b
on table_a.pkey = table_b.pkey
this space intentionally left blank
Click Here to Expand Forum to Full Width