Home » RDBMS Server » Server Administration » display "NULL" for null value ?
display "NULL" for null value ? [message #371536] Fri, 03 November 2000 03:04 Go to next message
Angu
Messages: 1
Registered: November 2000
Junior Member
Could anyone tell me how to display the "NULL" instead of notting in the screen.
eg.
a table test contains
rownum a
------ ---
1 1
2
3 3

Can I have the result like:
rownum a
------ ---
1 1
2 NULL
3 3

Thanks your advice!

Regs
Angus
Re: display "NULL" for null value ? [message #371537 is a reply to message #371536] Fri, 03 November 2000 03:17 Go to previous messageGo to next message
Angus
Messages: 18
Registered: October 2000
Junior Member
select nvl(to_char(a), 'NULL') from test;
Re: display "NULL" for null value ? [message #371538 is a reply to message #371536] Fri, 03 November 2000 05:33 Go to previous messageGo to next message
Sudha
Messages: 29
Registered: November 2000
Junior Member
SET NULL NULL
Re: display "NULL" for null value ? [message #372105 is a reply to message #371536] Wed, 10 January 2001 06:51 Go to previous message
Sandeep Udupa
Messages: 9
Registered: January 2001
Junior Member
SET NULL NULL.
This is a session time. Once you exit of SQL PLus prompt then again you have insert this statement on the SQL*PLUS prompt.

Another method use DECODE FUNCTION IN SQL*PLUS

SELECT empno, ename, job, mgr, hiredate, DECODE(SAL,NULL,'Null') "Sal", DECODE(COMM, NULL, 'Nul
Comm", deptno
FROM emp;
Previous Topic: selecting the nth record
Next Topic: Re: finding nth max of column in a table
Goto Forum:
  


Current Time: Sun May 19 05:44:42 CDT 2024