Table heading [message #199797] |
Thu, 26 October 2006 04:04 |
arunprabhu29917
Messages: 15 Registered: September 2006 Location: Tamilnadu
|
Junior Member |
|
|
please any one tell me
1. how to retrieve table with user defined heading like " this is employee table".
2.then how to provide the space between the column heading in output.
Thanks & regards,
Arunprabhu
[Updated on: Thu, 26 October 2006 04:08] Report message to a moderator
|
|
|
|
Re: Table heading [message #199805 is a reply to message #199801] |
Thu, 26 October 2006 05:03 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
In SQL*plus you can use the TTITLE command.
SQL> set pages 120
SQL> ttitle "This the employees table:"
SQL> SELECT employee_id
2 , last_name
3 FROM employees
4 WHERE rownum < 10;
Thu Oct 26 page
This the employees table:
EMPLOYEE_ID LAST_NAME
----------- -------------------------
100 King
101 Kochhar
102 De Haan
103 Hunold
104 Ernst
105 Austin
106 Pataballa
107 Lorentz
108 Greenberg
9 rows selected.
SQL> sho colsep
colsep " "
SQL> set colsep " -- "
SQL> SELECT employee_id
2 , last_name
3 FROM employees
4 WHERE rownum < 10;
Thu Oct 26 page
This the employees table:
EMPLOYEE_ID -- LAST_NAME
----------- -- -------------------------
100 -- King
101 -- Kochhar
102 -- De Haan
103 -- Hunold
104 -- Ernst
105 -- Austin
106 -- Pataballa
107 -- Lorentz
108 -- Greenberg
9 rows selected.
SQL> With colsep you can change the column separator. Don't forget to set the title off afterwards, because it will be repeated for each query and after the output exceeds the pagesize.
MHE
|
|
|