2

Before this gets voted as a duplicate question, I have spent quite some time on S.O. trying to fix this. As you can see in the screenshot below, my tables are looking messy.

For the first and second table, you can see how there are 2 sets of column headings for each table. So how can I, for example, get all 5 customer records to be included in one table?

The other thing I can't figure out is how to get the column headers to be properly formatted(not truncated and all on the same row). *I have tried changing the linesize, SET WRAP OFF; etc. enter image description here

If anyone could help explain this fix it would be greatly appreciated!

1
  • Hi. Please use text, not images/links, for text (including code, tables & ERDs). Use a link/image only for convenience to supplement text and/or for what cannot be given in text. And never give a diagram without a legend/key. Use edit functions to inline, not links, if you have the rep--make your post self-contained. Commented Dec 2, 2018 at 2:46

1 Answer 1

4

SQLPLUS layout mostly depends on :

  • what he thinks the width of your terminal is

  • either the length of the field that you ask it to display (as defined in the database structure), or the size of the field name

When the sum of the field lenghts is greater than the terminal size, each row is splitted over 2 or more lines... and the display gets messy.

But you do have control over these parameters.

First thing to do is to define a proper line size, ie one that fits well in your terminal screen. For example let’s make it 120 chars :

set linesize 120

You may then manually set the length of each field, if you are not satisfy with the length chosen by Oracle. For example for a varchar field you can do :

column first_name format a10

which allows a max length of 10 for the field called FIRST_NAME in the query result. The setting applies to all column with the same name, even in the subsequent queries, for the lifetime of the session. It can be removed with :

column first_name clear

You also have the option of formatting data types, which will apply to all columns having the concerned data type.

For more information see the SQLPLUS documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.