Home » Other » Client Tools » VIEW TABLE OUT IN TERMINAL
VIEW TABLE OUT IN TERMINAL [message #643386] Tue, 06 October 2015 13:35 Go to next message
sabsac
Messages: 9
Registered: October 2015
Location: I
Junior Member
I am unable to view all the HR schema 'EMP table' columns and part of the data is going beyond the print screen. what is optimum page width and line size to be able to view the data of all the columns I one screen view.I am using oracle command line.set wrap off or on is not helping
Re: VIEW TABLE OUT IN TERMINAL [message #643387 is a reply to message #643386] Tue, 06 October 2015 14:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Set lines 32767

Note HR.EMP table does not exist.


Re: VIEW TABLE OUT IN TERMINAL [message #643390 is a reply to message #643387] Tue, 06 October 2015 23:39 Go to previous messageGo to next message
sabsac
Messages: 9
Registered: October 2015
Location: I
Junior Member
OK it is SCOTT.EMP table.the issue is how to resize the view to be able to view all the columns in the out put window.
Re: VIEW TABLE OUT IN TERMINAL [message #643397 is a reply to message #643390] Wed, 07 October 2015 00:49 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, that's one of the most useful advantages of GUI tools when compared to SQL*Plus.

You'll have to manually resize all columns, such as
SQL> select * From emp where rownum < 3;

     EMPNO ENAME      JOB              MGR HIREDATE        SAL       COMM
---------- ---------- --------- ---------- -------- ---------- ----------
    DEPTNO
----------
      7369 SMITH      CLERK           7902 17.12.80       1600
        20

      7499 ALLEN      SALESMAN        7698 20.02.81       2400        300
        30


SQL> col empno format 99999
SQL> col ename format a8
SQL> col job format a9
SQL> col mgr format 9999
SQL> col sal format 9990D00
SQL> col comm format 990D00
SQL> col deptno format 99
SQL> select * From emp where rownum < 3;

 EMPNO ENAME    JOB         MGR HIREDATE      SAL    COMM DEPTNO
------ -------- --------- ----- -------- -------- ------- ------
  7369 SMITH    CLERK      7902 17.12.80  1600,00             20
  7499 ALLEN    SALESMAN   7698 20.02.81  2400,00  300,00     30

SQL>

Re: VIEW TABLE OUT IN TERMINAL [message #643398 is a reply to message #643397] Wed, 07 October 2015 00:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Set linesize is sufficient:
SQL> set lines 120
SQL> select * from emp;
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 17/12/1980 00:00:00        800                    20
      7499 ALLEN      SALESMAN        7698 20/02/1981 00:00:00       1600        300         30
      7521 WARD       SALESMAN        7698 22/02/1981 00:00:00       1250        500         30
      7566 JONES      MANAGER         7839 02/04/1981 00:00:00       2975                    20
      7654 MARTIN     SALESMAN        7698 28/09/1981 00:00:00       1250       1400         30
      7698 BLAKE      MANAGER         7839 01/05/1981 00:00:00       2850                    30
      7782 CLARK      MANAGER         7839 09/06/1981 00:00:00       2450                    10
      7788 SCOTT      ANALYST         7566 19/04/1987 00:00:00       3000                    20
      7839 KING       PRESIDENT            17/11/1981 00:00:00       5000                    10
      7844 TURNER     SALESMAN        7698 08/09/1981 00:00:00       1500          0         30
      7876 ADAMS      CLERK           7788 23/05/1987 00:00:00       1100                    20
      7900 JAMES      CLERK           7698 03/12/1981 00:00:00        950                    30
      7902 FORD       ANALYST         7566 03/12/1981 00:00:00       3000                    20
      7934 MILLER     CLERK           7782 23/01/1982 00:00:00       1300                    10

Re: VIEW TABLE OUT IN TERMINAL [message #643421 is a reply to message #643386] Wed, 07 October 2015 06:33 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
Since you are doing this with sqlplus in the command window, you are inherently limited to the width of the command windows. sqlplus has no control over that. Set linsize to a fairly large number, set trimspool on, spool the output, then view the spooled file in an editor which will allow for viewing longer lines and horizontal scrolling.

Or, as others suggested, use a gui front end
Re: VIEW TABLE OUT IN TERMINAL [message #643429 is a reply to message #643421] Wed, 07 October 2015 07:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You can scroll also your window inside which sqlplus is executing.
Also set trimout on.

Re: VIEW TABLE OUT IN TERMINAL [message #643433 is a reply to message #643429] Wed, 07 October 2015 08:18 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
vertical scroll sure, horizontal not so much, unless you're running the old gui sqlplus. If you're running it from cmd or putty or similar it'll just wrap the lines.
Re: VIEW TABLE OUT IN TERMINAL [message #643439 is a reply to message #643386] Wed, 07 October 2015 09:32 Go to previous messageGo to next message
thatjeffsmith
Messages: 81
Registered: July 2009
Location: Raleigh, NC
Member

We're working on a new command line interface called SQLcl.

It has a mode that will auto-format your query results, page by page.

No column or linesize formatting required.

If you're curious...

http://www.slideshare.net/hillbillyToad/sqlcl-overview-a-new-command-line-interface-for-oracle-database

Slide 26 in particular...

SQL> set sqlformat ansiconsole

SQL> select Employee_Id ,
  2  First_Name ,
  3  Last_Name ,
  4  Email ,
  5  Phone_Number ,
  6  Hire_Date ,
  7  Job_Id ,
  8  Salary ,
  9  Commission_Pct ,
 10  Manager_Id ,
 11  Department_ID
 12  from hr.employees
 13  fetch first 10 rows only;


http://www.thatjeffsmith.com/wp-content/uploads/2015/10/ansiconsole_emp.png
Re: VIEW TABLE OUT IN TERMINAL [message #643449 is a reply to message #643433] Wed, 07 October 2015 10:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
cookiemonster wrote on Wed, 07 October 2015 15:18
vertical scroll sure, horizontal not so much, unless you're running the old gui sqlplus. If you're running it from cmd or putty or similar it'll just wrap the lines.


Sure?
/forum/fa/12880/0/
/forum/fa/12879/0/
As you can see I can scroll the output.
An if you look at the scroll bar, I can scroll much (up to 9999 characters).
This is no more old sqlplus, it is the lone one, now (it kills all other SQL*Plus variants Smile ).

  • Attachment: OraFAQ2.jpg
    (Size: 56.34KB, Downloaded 1980 times)
  • Attachment: OraFAQ1.jpg
    (Size: 71.77KB, Downloaded 1979 times)
Re: VIEW TABLE OUT IN TERMINAL [message #643450 is a reply to message #643449] Wed, 07 October 2015 10:25 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Doesn't work on mine. Which windows version?
Re: VIEW TABLE OUT IN TERMINAL [message #643451 is a reply to message #643450] Wed, 07 October 2015 10:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The only one: XP. Laughing

Re: VIEW TABLE OUT IN TERMINAL [message #643452 is a reply to message #643450] Wed, 07 October 2015 10:33 Go to previous message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Don't forget that you can always change the properties of the window size of a command prompt.
Previous Topic: forms and reports Windows 8.1
Next Topic: Problem with high ASCII characters in Oracle 11G
Goto Forum:
  


Current Time: Fri Mar 29 06:45:14 CDT 2024