Formatting display

All posts relating to Oracle database administration.

Moderator: Tim...

Senior Member
Posts: 234
Joined: Tue May 19, 2009 12:59 am

Formatting display

Postby kytemaniac » Fri Apr 05, 2013 7:42 am

rdbms version

Code: Select all

EXCEL@shielo>select * from v$version;


Oracle Database 11g Enterprise Edition Release - 64bit Production
PL/SQL Release - Production
CORE      Production
TNS for Linux: Version - Production
NLSRTL Version - Production

here's my code

Code: Select all

set sqlprompt "_user'@'_connect_identifier>"

--set echo on

select sys_context('userenv','sid') from dual;

column segment_name a30
column space_in_g format 9.9999

select segment_name, sum(bytes)/1024/1024/1024 space_in_g from user_segments group by segment_name order by sum(bytes);

set echo off

here's my output

Code: Select all


from ... #sthref550 I've already format my number columns but I still do not understand why my output is not something I desired, would appreciate if someone could tell me what I need to do

my desired output is as follow

Code: Select all

segment_name  space_in_g

just don't understand why it does not spool as what I desired

from ... m#i2699209

COLUMN FORMAT settings take precedence over SET NUMFORMAT settings, which take precedence over SET NUMWIDTH settings.

Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: Formatting display

Postby Tim... » Fri Apr 05, 2013 7:53 am


You missed out the FORMAT keyword.

Code: Select all

column segment_name a30

Should be:

Code: Select all

column segment_name format a30


Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website:
My blog:

Return to “Oracle Database Administration”

Who is online

Users browsing this forum: No registered users and 1 guest