Whenever, I select rows from our tables, the results are very hard to read as they get wrapped over several lines. Is there a way by which we can format all the columns in them to a more readable format ? like trim the varchars.
It will be great if there is a script for this, eg called setTableFormat.sql. Just before I select data from tables, in sql prompt, I can call this script. The script must be a generic one for all tables, I do not want to specify the column names there.
If you know of anything like that, please let me know
Thanks in advance for your help
03-19-2001, 02:19 PM
What tool are you using to view your data? Is it SQL*PLUS?
If yes, you need to find the 'glogin.sql' file in your Oracle directory. This files contains all global paramters when you log into the system. Simply add the following line at the end of the file:
SET LINESIZE 2000
Hope this helps!
03-19-2001, 03:18 PM
Yes, we are using sql plus.
if I do,
select * from userdetails; //this table has 2 rows
It first displays all the headings for 1 row. This takes up 2 lines. Then it displays the row. This also takes up another 2 lines with lots of blank spaces in between ( as many cols are null). Then it displays the second row (2 more lines) and THEN it displays the column names again (2 more lines). Can this be compacted and trimmed out ? like display the column names first in one line and the values for the columns in 1 line each ? Because, though I have set my column size to be varchar2 (30). The value in it is only 10 chars. Can I set a default to trim those column values ? I think right now, each column is taking up as much space as specified, though the data isnt that long.