Formatting display

All posts relating to Oracle database administration.

Moderator: Tim...

Formatting display

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

rdbms version

Code: Select all
EXCEL@shielo>select * from v$version;

BANNER
-------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - 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

SEGMENT_NAME                                                                   
--------------------------------------------------------------------------------
SPACE_IN_G                                                                     
----------                                                                     
SB_MERCHANT_NW                                                           
     .0001                                                                     



from http://docs.oracle.com/cd/E11882_01/ser ... #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 http://docs.oracle.com/cd/E11882_01/ser ... m#i2699209

COLUMN FORMAT settings take precedence over SET NUMFORMAT settings, which take precedence over SET NUMWIDTH settings.
kytemaniac
Senior Member
 
Posts: 234
Joined: Tue May 19, 2009 12:59 am

Re: Formatting display

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

Hi.

You missed out the FORMAT keyword.

Code: Select all
column segment_name a30


Should be:

Code: Select all
column segment_name format a30


Cheers

Tim...
Tim...
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: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17950
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK


Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 3 guests