Run SQL statement from one Linux command
Posted by Kamran Agayev A. on December 6th, 2008
These two examples shows you how to run SQL command directly from Linux in a single command
[oracle@localhost~] echo “select count(*) from tab;” | sqlplus -s username/pass
With another method, you can run from one Linux command a SQL file
[oracle@localhost~] sqlplus -s username/pass <filename.sql
COUNT(*)
————-
20
[oracle@localhost~]