Solved

How to format an Oracle null value Number?

Posted on 2008-10-02
5
1,172 Views
Last Modified: 2013-12-19
Hi,

I have a number as TOTAL(15,4) Oracle.

If it is not null, it will print as:

00000000000.0000

If the TOTAL is null, I would like it to print like:

          0.0000

Leaving 10 empty spaces before the value 0.0000

How do I do that in pl/sql?


Thanks.
_Esam.
0
Comment
Question by:_Esam
5 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 63 total points
ID: 22624904
NVL(total,lpad('0.0000',15))
0
 
LVL 29

Assisted Solution

by:MikeOM_DBA
MikeOM_DBA earned 62 total points
ID: 22626580
Try:


Select TO_CHAR(NVL(Total,0),'99999999990.0000') From MyTable;

Open in new window

0
 
LVL 3

Expert Comment

by:gajmp
ID: 22653154
SELECT TO_CHAR(NVL(TOTAL, 0),'0000000000.0000') FROM TEST_TAB
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
select only modified column name  based on the status 15 47
Concat multi row values of a field in oracle 6 56
VB.Net - Oracle BulkCopy from CSV Date Format 7 47
Queries 15 34
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now