Setting LINESIZE [message #438016] |
Wed, 06 January 2010 14:34  |
Anne Simms
Messages: 163 Registered: May 2002 Location: San Francisco, CA
|
Senior Member |
|
|
Hi,
How do you determine or what is the proper way to set a linesize in sql*plus? I don't just want to make up a number. Any suggestions would be greatly appreciated.
Anne
|
|
|
Re: Setting LINESIZE [message #438018 is a reply to message #438016] |
Wed, 06 January 2010 14:40   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Simply, if it is too short, enlarge it.
An example:SQL> set linesize 80
SQL> select * from emp where rownum = 1;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- ---------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17.12.1980 800
20
SQL> set linesize 120
SQL> /
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- ---------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17.12.1980 800 20
SQL>
I just *look at it* and, if the output takes two lines, I enlarge its size.
[Updated on: Wed, 06 January 2010 14:42] Report message to a moderator
|
|
|
|
|
Re: Setting LINESIZE [message #438077 is a reply to message #438019] |
Thu, 07 January 2010 01:14   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Wed, 06 January 2010 21:40I usual set it to 120, it is not too large to be easy to read
Huh??
What happened to the "Keep your lines at a max of 80 chars because people cannot read it otherwise"?
|
|
|
Re: Setting LINESIZE [message #438095 is a reply to message #438077] |
Thu, 07 January 2010 01:54   |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
As I said when we talked about line width, asking 80 characters let's hope that it will be under 100 or 120.
In addition, 120 characters can fit in printed page width but not in my window screen without scrolling.
And if you want to know everything, 95% of my reports fit in 80 characters width just few of them needs more. Setting it to 120, does not mean using 80 each time but prevents from line fold in case of it exceeds it.
And in the end, my remark was above all to analyze code/query (on screen), I maintain that more than 80 characters leads to move eyes/head (if not scrolling window) to read the whole code line and when you come to the end of the line, you forget the details of the beginning and have to go back and forth to understand it.
Hope this is clear now. I know this was a kind dig from you but wanted to reply a little bit seriously for beginner developer. Long lines lead to codes harder to read and understand and to bugs and are more difficult to maintain.
Regards
Michel
|
|
|
|
|
|
|
|
Re: Setting LINESIZE [message #439131 is a reply to message #439130] |
Thu, 14 January 2010 10:16   |
Anne Simms
Messages: 163 Registered: May 2002 Location: San Francisco, CA
|
Senior Member |
|
|
Also what if linesize was set to 9000 and set trims on was also set.. will this still help with the trailing spaces?
In what case would a report need to be more than 120? I haven't seen this often.
|
|
|
Re: Setting LINESIZE [message #439133 is a reply to message #439131] |
Thu, 14 January 2010 10:20   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Long linesizes are used typically for results that are spooled to a file, not intended to be printed, but intended to be sent to other applications.
Trimspool always cuts back to the last non space characters.
|
|
|
|
|
|