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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

sqlplus 'set null'

794093Aug 27 2010 — edited Aug 27 2010
Again, new to sqlplus and Oracle, so thanks in advance.

I am using 'set NULL "0"' to print a zero when I have a null value.
The problem I am having is that the "0" that is printing does not
seem to be behaving like the other column values (which are numbers).

set heading off
set echo on
set newpage 1
set pagesize 55
set linesize 66
column FW_STREAM_NAME FORMAT a20
column SUM(TOTAL_RECORDS) FORMAT 9,999 JUSTIFY RIGHT
--set NULL '0'
SELECT FW_STREAM_NAME, SUM(TOTAL_RECORDS) from BL_STATISTICS_FILE WHERE created_timestamp between
TO_DATE('20100826000000','yyyymmddhh24miss') AND
TO_DATE('20100826235900','yyyymmddhh24miss') GROUP BY FW_STREAM_NAME

and here is the output:


APPLES12345 2,810
ORANGES3456 36
BANANAS12456 16
PEARS6789 0
CHERRIES 131

Everything is lined up except my special column, where sqlplus has replace the null with
a "0" as I asked it to.

How can I get it to line up with the rest of the numerical column entries?

Thanks,

Mitch
This post has been answered by Sven W. on Aug 27 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2010
Added on Aug 27 2010
5 comments
4,123 views