Re: SQLPlus <-Passing Variables into a script
Date: 8 Nov 1994 23:19:01 GMT
Message-ID: <39p115$rfp_at_newsserver.trl.OZ.AU>
In article <39mnce$773_at_pandora.sdsu.edu>, fukumae_at_io.nosc.mil (Wallace Fukumae) says:
>
..
.
>sqlplus {username}/{password} << end-of-sql
>create synonym &Username..folder for master.folder;
><< end-of-sql
>
Wally,
Had the same question put to me a few days ago. What you could do is to have the name of the user,'Username' or any parameters for that matter placed in an external file eg username.txt So the content of username.txt is:
MYUSERNAME You then call your sqlplus as such
sqlplus <<EOF
{username}/{password}
create synonym &Username..folder for master.folder;
`cat username.txt`
EOF
Note two things. The quote around 'cat username.txt' is the back
quote "`". Also, I have placed the username and password within the
'here document' block rather than on the first. This is for security
reasons on some UNIX boxes.
Hope that helps
ta
tony
_____ ________ / ___|Tony Jambu, Database Consultant /_ _ /_ __ / |Wizard Consulting, Aust (ACN 065934778) /(_)/ )(_/ \_/(///(/_)/_( |CIS:100250.2003_at_compuserve.com FAX:+61-3-2536173 \_______/ |EMAIL:TJambu_at_wizard.com.au PHONE: +61-3-2536385Received on Wed Nov 09 1994 - 00:19:01 CET