1

Let say I need to execute some sql code from shell script.
What could be simple and neat approach to do this?

1
  • There are already a lot of questions about running SQL*Plus from a shell script - is another one useful? Commented Mar 24, 2016 at 17:15

1 Answer 1

2
sqlplus -s /nolog <<EOF
whenever sqlerror exit sql.sqlcode;
set echo on;
set serveroutput on;
connect <user>/<pass>@<host>:<port>/<sid>

delete from <table_name> where <...>;
...

quit;
EOF
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.