Passing Shell variables to SQLPLUS for execution

Passing Shell variables to SQLPLUS for execution

 

  

Hi.. This is Jimy and I am new to the subject.Request your help on resolving the issue on hand.
I have a unix shell script thru which a user enters UserId and Passwd.The same data that of the USER and PASSWD needs to send to SQL for exection and retriving a possible valid response.
Hope you revert back.


PASS >cat EnterPass.sh
#! /bin/csh -f
clear

printf "\n\n \n\n #####################################\n\n\n "

printf "\n\t\t\tEnter your Login ID : \t"
set LOGINID = $<

printf "\n\n\t\t\tEnter your Password : \t"
stty -echo
set PASSWD = $<
stty echo
printf " \n\n\n\n #####################################\n\n \n "

echo "Login ID = $LOGINID "
echo "PassWord = $PASSWD "


set login=$LOGINID
set pass=$PASSWD

echo $login
echo $pass


sqlplus oasis/prod123 @verify.sql

Note: pass the values stored in the variables $login and $pass to SQL to Execution.
please tell me how can the values be dynamicaly passed.
I tried different options but i am not able to get thru , request you to look into it.
======================================================================

File 2.Verify.sql

accept uid char prompt 'Enter Login ID : '
accept pwd char prompt 'Enter Password : '

select * from userpass where
login ='&uid' and trim(pass) = translate('&pwd','abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()','1234567890!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ');
exit;

On manual entry I am getting the records., i also want to get a result variable so.. that i can prompt a suitable response back to the user..that the login was successfull and vice versa.

------------------------------------------------------------------------
This e-mail contains confidential and/or privileged information.If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure, use or distribution of the material in this e-mail
is strictly forbidden.
------------------------------------------------------------------------


Oracle LazyDBA home page