tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: masauso zimba <zimbama () venus ! mcm ! com ! zm>
To: tru64-unix-managers
Subject: Running SQLPLUS commands from a UNIX script
Date: Tue, 20 Jul 1999 17:10:42 +0000	[thread overview]
Message-ID: <96079058315934.tru64-unix-managers.marc@archive.invalid> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="--------------605FFB9F63207E531346EBE3", Size: 2335 bytes --]


--------------605FFB9F63207E531346EBE3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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 , @list_suppliers. When I
want to execute this  sqlplus script from a UNIX script (sup_list);

#!/bin/sh
#
sqlplus user/password
@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.

--------------605FFB9F63207E531346EBE3
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
<FONT SIZE=-1>At our site, we are running ORACLE 7.3.4 and we would like
to automate running SQLPLUS command scripts.&nbsp; For example the following
sqlplus script (list_suppliers.sql);</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>select supplier_no,supplier_name from suppliers;</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>can be executed from the SQLPLUS command line , @list_suppliers.
When I want to execute this&nbsp; sqlplus script from a UNIX script (sup_list);</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>#!/bin/sh</FONT>
<BR><FONT SIZE=-1>#</FONT>
<BR><FONT SIZE=-1>sqlplus user/password</FONT>
<BR><FONT SIZE=-1>@list_suppliers</FONT>
<BR><FONT SIZE=-1>exit</FONT>
<BR><FONT SIZE=-1>#</FONT>
<BR><FONT SIZE=-1>#</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>To execute this script from UNIX prompt;</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>$ ./sup_list</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>The result is that the script executes the "sqlplus user/password"
command only and remains at the SQLPLUS command prompt.</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>What is the correct syntax to enable execution of SQLPLUS
commands within UNIX scripts ?</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>Thanking you in advance.</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>Masauso Zimba.</FONT></HTML>

--------------605FFB9F63207E531346EBE3--

                 reply	other threads:[~1999-07-20 17:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox