Re: Novice question -- how to I run script in unix sqlplus?

From: Kevin Counts <kcounts_at_helios.acomp.usf.edu>
Date: 22 Jun 2002 17:01:14 -0700
Message-ID: <f2ac0433.0206221601.17c3e2d8_at_posting.google.com>


jobowker <member_at_dbforums.com> wrote in message news:<3d12c49d$5_at_usenetgateway.com>...  

> This is how I execute sql statements from a unix ksh script:

I like checking for the oracle user .. i have a similar script which checks $HOME/bin/ora (i keep this script "rsql" in $HOME/bin before looking at the immediate path). Because I often > this into a file for further manipulation I turn off feedback,headings,etc..

Regards,

Kevin Counts

#!/bin/sh
#------------------------------------------
#
# File: rsql
#
# Desc: automatically logs into Oracle and
#       runs the specified sql script
#
# Use:  rsql.sh "sqlscript" [param1] ... [param9]
#
#------------------------------------------

sql_script=$1

if [ ! -f $sql_script ]; then

   sql_script=$HOME/bin/ora/$1
fi

shift
sqlplus -s '/ as sysdba' <<EOF
set echo off;
set head off;
set linesize 132;
set pagesize 10000;
set ver off;
set feed off;
_at_${sql_script} $@;
quit;
EOF Received on Sun Jun 23 2002 - 02:01:14 CEST

Original text of this message