Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

coalesce with different data types

user32322435Aug 31 2010 — edited Aug 31 2010
Hi All,

I'm working in Oracle 10g R2.

I have the following function and each record would have one of the below fields populated..where Im trying to get the non-null value to be the "actual_data". When I try to run I get the following error

VALUE_NBR is a NUMBER field in the table
VALUE_DT is a DATE field in the table
VALUE_CD is a VARCHAR2 field in the table
VALUE_TXT is a VARCHAR2 field in the table
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
COALESCE(VALUE_NBR,VALUE_DT,VALUE_CD,VALUE_TXT) AS ACTUAL_DATA,
Please suggest me an workaround or an alternative..I tried NVL..which had the same error as well.


Thanks in advance
HU
This post has been answered by Hoek on Aug 31 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2010
Added on Aug 31 2010
2 comments
2,580 views