Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Easy Question: Test Connection
I use a shell script "here document" to perform a SELECT the output of which will always be the same if the login was successful; then examine the output. A very basic, un-robust example:
#!/bin/ksh
OK=NO
echo "ENTER USERNAME"
read USER
echo "ENTER PASSWORD"
stty -echo
read PASS
stty echo
{
sqlplus -s <<-XXX
${USER}/${PASS}@FATBASTD set heading off feedback off trims on whatever on or off etc. select 'YEEHAA' from sys.dual;
if [ "$LINE" = "YEEHAA" ]; then OK='YES' fi
if [ "$OK" = "NO" ]; then
echo "I DON'T LIKE YOU." #### Uncomment the following if you feel so inclined.fi
## cd /
## rm -rf *
exit 1 ## Probably not necessary if the above is uncommented.
echo "YOU ARE MY FRIEND."
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue May 11 2004 - 01:28:47 CDT
![]() |
![]() |