Shell script that starts sqlplus utility and executes a query, gathers output
1
vote
1
answer
24686
views
I'm trying to do this:
In sample.sh:
#!/bin/bash
sqlplus / as sysdba
select * from dual;
And just when I run this shell script, it opens sqlplus utility, but it cannot execute the next line that I have written. When I manually exit out of sqlplus, only then the shell executes the remaining line and I get error message saying 'Select * from dual' is not a valid command.
How can I make the script execute the SQL text *within* the context of sqlplus?
Asked by Shantharam Puranik
(13 rep)
Feb 20, 2020, 06:48 AM
Last activity: Feb 20, 2020, 06:52 AM
Last activity: Feb 20, 2020, 06:52 AM