Home » SQL & PL/SQL » Client Tools » Seeing the full column caption (Oracle ,9i,Windows Xp)
Seeing the full column caption [message #340333] Tue, 12 August 2008 06:34 Go to next message
shachipathak
Messages: 16
Registered: December 2007
Location: Bangalore
Junior Member
Dear Sir,
When i run the query
SELECT TRANSLATE(
'HELLO WORLD', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ',
'1234567890!@#$%^&*()-=_+;,.') ENCODED_MESSAGE
FROM DUAL
/

The Output is



ENCODED_MES
-----------
85@@% _%*@4

Why i am not able to see the full column name?
What is the solution?


Thanks
Shachi

Re: Seeing the full column caption [message #340337 is a reply to message #340333] Tue, 12 August 2008 07:06 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Set the column format, such as
SQL> col encoded_message format a15
SQL> SELECT TRANSLATE(
  2  'HELLO WORLD', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ',
  3  '1234567890!@#$%^&*()-=_+;,.') ENCODED_MESSAGE
  4  FROM DUAL
  5  /

ENCODED_MESSAGE
---------------
85@@%._%*@4

SQL>
Re: Seeing the full column caption [message #340339 is a reply to message #340333] Tue, 12 August 2008 07:14 Go to previous messageGo to next message
shachipathak
Messages: 16
Registered: December 2007
Location: Bangalore
Junior Member
But Sir,
If i am making some dynamic queries where the column names will keep changing.

How will i format the columns?

What will be the solution?

Thanks
Shachi
Re: Seeing the full column caption [message #340340 is a reply to message #340333] Tue, 12 August 2008 07:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The reason is that Oracle and then SQL*Plus are smart enough to know the column max size and SQL*Plus adapt the result column to this size.

As Littlefoot said the workaround is to set the size by yourself.

Regards
Michel
Re: Seeing the full column caption [message #340416 is a reply to message #340333] Tue, 12 August 2008 12:40 Go to previous message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
In SQL, it is also possible to cast result to required length (however if used further, it will be trimmed when longer)
SQL> select cast( 'sss45678901234567890' as varchar2(15) ) encoded_string from dual;

ENCODED_STRING
---------------
sss456789012345
Previous Topic: Free GUI tool (like toad )required for running SQL/PL/SQL
Next Topic: How to prevent accessing of isqlplus
Goto Forum:
  


Current Time: Sat Dec 10 11:12:21 CST 2016

Total time taken to generate the page: 0.12941 seconds