My Oracle Support Banner

Error in SQL*Plus when Using Shell Script (Doc ID 1472150.1)

Last updated on APRIL 16, 2021

Applies to:

SQL*Plus - Version 10.1.0.2 to 11.2.0.3 [Release Oracle10g to 11.2]
Generic UNIX

Symptoms

Disclaimer: The illustration here is provided by way of example only, and is not intended to replace or alter the way sql*plus works. Examples of analysis performed within this article are only examples. Oracle Support does not troubleshoot shell scripts or custom scripts and does not suggest using it on Production environment.

When using bash profile to execute SQL commands, it errors out when it encounters some special characters.

For example, consider the following script:

 The select count(*) from v_$session will work absolutely fine when issued directly using sqlplus, whereas when issued through shell script it errors out.

Cause

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
Symptoms
Cause
Solution


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