My Oracle Support Banner

How to Make SQLPLUS Script in UNIX Shell Produce Output on Same Line (Doc ID 778846.1)

Last updated on MARCH 30, 2020

Applies to:

SQL*Plus - Version to [Release 8.1.7 to 11.2]
Generic UNIX


A Simple Select statement is executed from within a shell environment.
The value returned by the select query is transferred back to the shell.
However the result produced will have an empty line in it.
For example:

will produce the result as:


Result expected is:


This is expected behavior and hence the value will be returned on a new line.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.