You can try STDin
`$sql barry/oracle << EOF
select user from dual;
EOF`
SQLcl: Release 12.2.0.1.0 RC on Mon Aug 08 18:29:09 2016
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Mon Aug 08 2016 18:29:10 +01:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
USER
BARRY
BARRY@orcl☘ >
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
and coming back again, you can echo it in to have a truely single line experience.
C:\TMP>echo select 1 from dual|\software\sqlcl\bin\sql barry/oracle@localhost:1521/xe
SQLcl: Release 17.2.0 Production on Tue Aug 29 18:13:40 2017
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
1
----------
1
SQL>
SQL>
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
C:\TMP>