Sqlplus EOF In Unix Shell Script
Running SQL Plus using EOF method in Unix shell script was not hard to write. We have seen lots of programming practice and most of the shell script will call the SQL execution via sqlplus username/password @script.sql.
This file calling method was widely used around and the programmer just need to amend the script.sql for changes.
Some programmer or System Administrator wants to maintain single file which was the Unix shell script and embed the SQL script if possible.
The following of the Unix shell script shows how we can call the SQL command by using the EOF execution method.
SQL Plus EOF Execution Method
#!/bin/ksh echo "Begin SQL Plus" sqlplus -s user/password << EOF select count(*) from all_objects exit EOF echo "End SQL Plus"
Remember, it is not mandatory to use the word “EOF” in your shell script.
Any other word will be accepted as well such as “!” and the rule is the opening and closing word of the SQL command should be the same.
Related Posts
- Add/Register Shell Script In Oracle Applications
- How To Create Shell Script
- Invoking SQL Loader HostCommand Using PL/SQL
- HostCommand Unix Call From Oracle SQL
- Unix Printer Monitoring Script
PreviousNext» Warning: Remote Host Identification Has Changed



