Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

error on execution of sql script that has substitution variables

$
0
0
Hello Friends,

I am am running a sql script through unix script file . The sql script file has substitution parameters where the user has to provide values at run time .. when I am trying to use that script in .sh inorder to run it , its giving me error

Enter value for workschemaname:
SP2-0546: User requested Interrupt or EOF detected.
Enter value for oemsbscsblschema:
SP2-0546: User requested Interrupt or EOF detected.


Here my .sh file

#!/bin/bash
source /usr/local/bin/setora-11g
SQL=$ORACLE_HOME/bin/sqlplus
LogDirectory='/tmp/logs'
PATH=/app/sql/fresh_install.sql
echo "Enter UserName to connect to DATABASE :\n"
read username
DBUSER=$username
echo "Enter Password :\n"
read pwd
DBPWD=$pwd
echo " Enter Host String : \n"
read host
MYDB=$host
$SQL -s $DBUSER/$DBPWD@$MYDB << EOF
set linesize 32767
set feedback on
set serveroutput on
@$PATH

EOF

fresh_install.sql has a &&workschemaname

How to accept the user paramter into the sql file ?

thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles