Running SQLPLUS commands from a UNIX script

From: masauso zimba <zimbama_at_venus.mcm.com.zm>
Date: Tue, 20 Jul 1999 10:10:42 -0700

At our site, we are running ORACLE 7.3.4 and we would like to automate
running SQLPLUS command scripts. For example the following sqlplus
script (list_suppliers.sql);

select supplier_no,supplier_name from suppliers;

can be executed from the SQLPLUS command line , _at_list_suppliers. When I
want to execute this sqlplus script from a UNIX script (sup_list);

#!/bin/sh
#
sqlplus user/password
_at_list_suppliers
exit
#
#

To execute this script from UNIX prompt;

$ ./sup_list

The result is that the script executes the "sqlplus user/password"
command only and remains at the SQLPLUS command prompt.

What is the correct syntax to enable execution of SQLPLUS commands
within UNIX scripts ?

Thanking you in advance.

Masauso Zimba.
Received on Tue Jul 20 1999 - 08:12:21 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT