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 184.108.40.206 to 220.127.116.11 [Release 8.1.7 to 11.2]
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.
RESULT=`sqlplus -s <USER>/<PASSWORD>@<TNS_ALIAS>' <set head off feedback off
select X from dual;
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