Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Plus report formating

Status
Not open for further replies.

mdarsot

Instructor
Apr 13, 2006
86
CA
I have a numeric filed called Ship_ID in table which is typ VARCHAR2(6)

When i desplay the result of my query it displays in following format


SHIP_ID
----------
72


The width is 10 space long. I will not exceed for short term width more then 4 spaces. How can i reduce the size of the field on display to only 4 spaces like below


SHIP
ID
----
72
 
You could try entering one of these before the select statement

[tt]
column SHIP_ID format a4 --Character format
column SHIP_ID format 9999 --Numeric format
[/tt]
 
i tried column SHIP_ID format 9999
still same results
SHIP_ID
-------
74


no change.
 
Sorry about that. I'll try something else. In the meantime, I did test with a character value and it worked for that:

[tt]
SQL> column SHIP_ID format a4
SQL> select 'Ted' EmpName, '72' Ship_Id
2 from dual;

EMP SHIP
--- ----
Ted 72
[/tt]
 
How about this?

[tt]
SQL> column SHIP_ID Heading "Ship|ID" format 999
SQL> select 'Ted' EmpName, 72 Ship_Id
2 from dual;

Ship
EMP ID
--- ----
Ted 72
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top