Format the output of numeric scientific notation(12E+10) in sqlplus

Format the output of numeric scientific notation(12E+10) in sqlplus

In sqlplus commandline, we dont get proper output on the screen for large number because of width and column number format rather we get scientific notation which is absurd in case of dbid or scn number of a database.

There are two ways to get proper output with full digits

One variable is numwidth

kish@exdbx<>select 10000000000*9 from dual;

10000000000*9
-------------
   9.0000E+10

Elapsed: 00:00:00.00
kish@exdbx<>set numwidth 25
kish@exdbx<>select 10000000000*9 from dual;

            10000000000*9
-------------------------
              90000000000

Another variable is col column_name format 99999….

kish@exdbx<>select 10000000000*3 from dual;

10000000000*3
-------------
   3.0000E+10

Elapsed: 00:00:00.01
kish@exdbx<>col 10000000000*3 format 99999999999
kish@exdbx<>select 10000000000*3 from dual;

10000000000*3
-------------
  30000000000

Elapsed: 00:00:00.02

Leave a Reply

Discover more from XscalibaL

Subscribe now to keep reading and get access to the full archive.

Continue reading