Skip to Main Content

Oracle Database Discussions

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!

oracle 12c : ora -00932 inconsitent datatype number got char : select case statement

supersenJul 2 2019 — edited Jul 26 2019

Hello Guys

Need some help on the select case statement.

select case

when s.SOURCE_TYPE = 1 then r.SOURCE_REF

when s.PFILE is null then s.FILE

end fileName

        from mtas s,

        gtas r

      where s.ID = r.SOURCE_ID;

sourcetype and source_ref  are number datatypes

PFILE and S.FILE  are character datatypes

I am getting error as

ORA-00932 inconsitent datatypes number got char

first when condition is number . if i replace first when condition with  when s.SOURCE_TYPE = 1 then to_char(r.SOURCE_REF)  then it is working fine.

Kindly advise. i am using oracle 12c here

Thanks

S

Comments
Post Details
Added on Jul 2 2019
6 comments
4,727 views