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!

invalid number error

Roger25Apr 29 2026

Hello,

I don't understand why I have invalid number error here. Based on this, both expressions should evaluate to a character data type

select NVL(
to_char(decode(1, 2, 4, to_char(4)||'%')),
decode(2, 2, to_char(3)||'%',
to_char(3)
)) from dual

Basically, this

to_char(decode(1, 2, 4, to_char(4)||'%'))

can be either number or character, and also the second argument of nvl,

   decode(2, 2, to\_char(3)||'%',  
    to\_char(3)  

)

can be either number or character data type, depending on data (I put above just sample numbers).

Thanks!

This post has been answered by Gerrit van der Linden on Apr 29 2026
Jump to Answer
Comments
Post Details
Added on Apr 29 2026
2 comments
88 views