Home » SQL & PL/SQL » Client Tools » Column heading setting (Oracle 10g, Windows XP)  () 1 Vote
Column heading setting [message #575429] Wed, 23 January 2013 03:52 Go to next message
morad_dba
Messages: 72
Registered: June 2008
Member

Dear all,
I would like to have a column heading as follows in double inverted comma. but sqlplus environment returns column heading length equal to output value.

SQL> select substr('The independence day', 5,12) "Example of substr function"
2 from dual;

Example of s
------------
independence

I know that default column heading length is 30 character long.

but my column heading is less than 30 character long (which is 26)
How can i have column heading as Example of substr function ?

regards,
Morad.






Re: Column heading setting [message #575432 is a reply to message #575429] Wed, 23 January 2013 04:07 Go to previous messageGo to next message
rishwinger
Messages: 132
Registered: November 2011
Senior Member
SQL> SET LINESIZE 12
SQL> select substr('The independence day', 5,12) "Example of substr function" fr
om dual;

Example of s
------------
independence

SQL> select length('Example of substr function') as length from dual;

    LENGTH
----------
        26

SQL> SET LINESIZE 26
SQL> select substr('The independence day', 5,12) "Example of substr function" fr
om dual;

Example of substr function
--------------------------
independence



tested on 10g win 7

[Updated on: Wed, 23 January 2013 04:10]

Report message to a moderator

Re: Column heading setting [message #575433 is a reply to message #575432] Wed, 23 January 2013 04:14 Go to previous messageGo to next message
morad_dba
Messages: 72
Registered: June 2008
Member

Dear,

I tested in sql*plus environment

SQL> set linesize 100
SQL> select substr('The independence day', 5,12) "Example of substr function"
2 from dual;

Example of s
------------
independence

SQL>

I did not get full given column name.

Please help

Regards,
Morad.
Re: Column heading setting [message #575434 is a reply to message #575433] Wed, 23 January 2013 04:33 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

Can you try,what you are getting output.

show linesize
Re: Column heading setting [message #575435 is a reply to message #575434] Wed, 23 January 2013 04:36 Go to previous messageGo to next message
morad_dba
Messages: 72
Registered: June 2008
Member

I am getting as

SQL> set linesize 100
SQL> select substr('The independence day', 5,12) "Example of substr function"
2 from dual;

Example of s
------------
independence

SQL>


Re: Column heading setting [message #575436 is a reply to message #575435] Wed, 23 January 2013 04:40 Go to previous messageGo to next message
Michel Cadot
Messages: 59289
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> col "Example of substr function" format a26
SQL> select substr('The independence day', 5,12) "Example of substr function" from dual;
Example of substr function
--------------------------
independence

Regards
Michel
Re: Column heading setting [message #575437 is a reply to message #575436] Wed, 23 January 2013 04:41 Go to previous messageGo to next message
Michel Cadot
Messages: 59289
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Or:
SQL> col a format a26 heading "Example of substr function"
SQL> select substr('The independence day', 5,12) a from dual;
Example of substr function
--------------------------
independence

Regards
Michel
Re: Column heading setting [message #575442 is a reply to message #575437] Wed, 23 January 2013 05:00 Go to previous message
morad_dba
Messages: 72
Registered: June 2008
Member

Thanks Mr. Michel Cadot.

My problem is solved by your excellent feedback;

Thanks again.

Regards,
Morad.
Previous Topic: BR*Tools appearence not complete
Next Topic: connect to sql developer
Goto Forum:
  


Current Time: Wed Oct 01 07:28:14 CDT 2014

Total time taken to generate the page: 0.13951 seconds