New LINESIZE settings for SQLPlus

Posted by

Anyone that has used SQL Plus since its inception will be familiar with this frustration:

image

There is my window, with all of that lovely free space at the right hand side for the results of my query to flow into…but the output wraps anyway! This is because SQL Plus was born in a different era Smile, when terminals ruled the earth, not windows that can be resized on a whim. In the example above, I had my LINESIZE set to 60, and SQL Plus obediently wraps the output as it crosses that threshold.

But there is help at hand. Even if you are not running the latest version of the database, I encourage you to upgrade to the more recent versions of SQL Plus. From 18c onwards, there is an option to set the LINESIZE to a new value of WINDOW.  This allows the output to stretch in a more intuitive fashion to the size of the window SQL Plus is running in.

image

“But it is still wrapping!” I hear you exclaim. True, but that is the same as any other standard windows client tool. All you need to do now is resize the window and not need to bother tinkering with SQL Plus settings.

image

One comment

  1. Hi Connor,

    That is a brilliant improvement. It is thrilled to see that Oracle keeps making small improvements to SQL*Plus and has not abandoned it completely in favor of SQLcl, which is too slow in my book.
    When I initially learned about the LINESIZE WINDOW, it was slightly unexpected for me to find out that it changes the PAGESIZE as well:

    SQL*Plus: Release 19.0.0.0.0 – Production on Fri Jan 31 12:27:09 2020
    Version 19.3.0.0.0

    SQL> show linesize pagesize
    linesize 80
    pagesize 14
    SQL> set linesize window
    SQL> show linesize pagesize
    linesize 212 WINDOW
    pagesize 51

    Oracle actually documented that behavior: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqpug/SET-system-variable-summary.html#GUID-6C9EC78E-F27C-4588-A400-FE8732871B40

    Regards,
    Mikhail.

Got some thoughts? Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.