Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:44:26+00:00 2026-06-17T21:44:26+00:00

I ran the simple select query in the command prompt,but the output rows are

  • 0

I ran the simple select query in the command prompt,but the output rows are not coming in a single line. See below:

SQL> set pagesize 2000
SQL> select * from xtern_empl_rpt ;

EMP LAST_NAME
--- --------------------------------------------------
FIRST_NAME                                         SSN
-------------------------------------------------- ---------
EMAIL_ADDR
--------------------------------------------------------------------------------

YEARS_OF_SERVICE
----------------
001 Hutt
Jabba                                              896743856
jabba@thecompany.com
              18

002 Simpson
Homer                                              382947382
homer@thecompany.com
              20

003 Kent
Clark                                              082736194
superman@thecompany.com
               5

004 Kid
Billy                                              928743627
billythkid@thecompany.com
               9

005 Stranger
Perfect                                            389209831
nobody@thecompany.com
              23

006 Zoidberg
Dr                                                 094510283
crustacean@thecompany.com
               1


6 rows selected.

SQL>

Could you please help me to make each rows in a single line?

Edit

I tried below,but still is not prettified.

SQL> SET LINESIZE 4000
SQL> select * from xtern_empl_rpt ;

EMP LAST_NAME                                          FIRST_NAME
                          SSN       EMAIL_ADDR
                                                         YEARS_OF_SERVICE
--- -------------------------------------------------- -------------------------
------------------------- --------- --------------------------------------------
-------------------------------------------------------- ----------------
001 Hutt                                               Jabba
                          896743856 jabba@thecompany.com
                                                                       18
002 Simpson                                            Homer
                          382947382 homer@thecompany.com
                                                                       20
003 Kent                                               Clark
                          082736194 superman@thecompany.com
                                                                        5
004 Kid                                                Billy
                          928743627 billythkid@thecompany.com
                                                                        9
005 Stranger                                           Perfect
                          389209831 nobody@thecompany.com
                                                                       23
006 Zoidberg                                           Dr
                          094510283 crustacean@thecompany.com
                                                                        1

6 rows selected.

SQL>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:44:27+00:00Added an answer on June 17, 2026 at 9:44 pm

    set your column widths to fit in the screen

    eg:

    column EMAIL_ADDR format a30 
    

    where a is hte column width. you can use WRA to wrap the column
    eg

    column EMAIL_ADDR format a30 WRA
    

    or TRU to truncate, WOR to break on word boundaries

    for example:

    SQL> select * from emp;
    
            ID FIRST_NAME
    ---------- ------------------------------
    LAST_NAME
    ------------------------------
    EMAIL_ADDR
    --------------------------------------------------
             1 Dazza
    Smith
    d_dazzal@dazzal.com
    

    so the output is a bit tricky to read as email_addr was padded to 300 characters (as my table had it defined as varchar2(300) which sql*plus uses to format the output).

    first set an appropriate linesize:

       SQL> set linesize 100 
    

    now lets set the columns so they fit on one line (linesize should be greater than the total col widths):

       SQL> column email_addr format a30 
       SQL> column last_name format a20 
       SQL> column first_name format a20 
       SQL> select * from emp;
    
                ID FIRST_NAME           LAST_NAME            EMAIL_ADDR
        ---------- -------------------- -------------------- ------------------------------
                 1 Dazza                Smith                d_dazzal@dazzal.com
    

    so now the columns fit easily onto a reasonably sized terminal.

    in your case first_name and last_name are varchar2(50)’s yet the data in them is much smaller, so i’d start with column first_name format a15 (same for last_name). with email, your column is varchar2(100) yet the max sized output was 25 chars, so put column email format a25 for a starter.

    if you did that, you should get output (if linesize is high enough) like:

    SQL> select * from xtern_empl_rpt ;
    
    EMP LAST_NAME       FIRST_NAME     SSN       EMAIL_ADDR                YEARS_OF_SERVICE
    --- --------------- -------------- --------- ------------------------- ----------------
    001 Hutt            Jabba          896743856 jabba@thecompany.com      18
    

    finally as requested. WRA TRU and WOR. WRA is default by the way, so you dont have to use it but lets say we had:

    SQL> select * from test;
    
    A
    --------------------------------------
    THIS IS A SIMPLE WRAPPING TEST
    

    but i wanted to format this as 10 characters width:

    S

    QL> col a format a10 WRA
    SQL> select * from test;
    
    A
    ----------
    THIS IS A
    SIMPLE WRA
    PPING TEST
    

    the WRA means just chop the string at 10 chars, regardless of whether we are in the middle of a word or not. if we wanted to break ONLY on word endings (where possible as a word > 10 still needs to break):

    SQL> col a format a10 WOR
    SQL> select * from test;
    
    A
    ----------
    THIS IS A
    SIMPLE
    WRAPPING
    TEST
    

    now the output is broken at word boundaries and not necessarily at 10 chars.

    if we only wanted the first 10 chars and no line wrapping, we could use TRU:

    SQL> col a format a10 TRU
    SQL> select * from test;
    
    A
    ----------
    THIS IS A
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran the following simple query that looks like the example below: (Briefly; one
I am running the simple query below select '''' + event_number + '''' +','
I ran some simple tests: same complex query in mysql and php and measured
I'm using VB.NET. I am performing a select query that returns approximately 2500 rows,
I have this simple query that runs in 0.55s. SELECT tr.* FROM Tournament_Result tr,
I have a simple TRY CATCH with an embedded TRANSACTION in the below query.
We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we
Ran into this error message while trying to select some records off a table.
I ran the convert_to_south command on my app. Everything seems to have gone fine:
I have a very simple mysql query, I want to fetch some 'data' from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.