What is the Oracle equivalent of NVL for number datatypes?
This works since the datatype is VARCHAR:
select nvl(enrol.OUAC_APPLNO, 'blank') Invalid_OUAC_APPLNO
But this doesn't work since the datatype is NUMBER:
select nvl(enrol.ouac_type_id, 'blank') REGTYP
Ben :
There is no equivalent and no Oracle functions will accept this (apart from DECODE() but don't do that); you're going to have to convert your number to a character:\n\nselect nvl(cast(enrol.OUAC_APPLNO as varchar2(10)), 'blank') \n\n\nYou may need to change the number of characters you're converting to as appropriate.\n\nHowever, I don't know why you're doing this at all. By definition a NULL implies non-existence. If you want to display blank in order to confer non-existence this is something that you should be doing with your presentation layer rather than the database.",
2014-09-18T13:32:50
dursun :
it wont work because oracle wants every row should be in the same type otherwise you cannot run functions on that column, you have cast ouac_type_id to be varchar as below;\n\nselect nvl(cast(enrol.OUAC_APPLNO as varchar2(10)), 'blank') REGTYP\n",
2014-09-18T13:33:44