Hi everyone
i am using ksh scripts and db2. i need to check in my database if a particular user exists,
echo "PLEASE ENTER THE EMPLOYEE NUMBER"
read enumm
echo "PLEASE ENTER THE MANAGER USER ID"
read uid
echo "PLEASE ENTER THE MANAGER PASSWORD"
read pswd
. db2init
QYE=`db2 -x "select count(*) from manUser where EMPLOYEE#=$enumm and USERID='$uid' and PASSWORD='$pswd'"`
echo "$QYE"
if [[ $QYE = 1 ]]
then
echo "existssss"
else
echo "doesn't exist"
the output is
PLEASE ENTER THE EMPLOYEE NUMBER
1
PLEASE ENTER THE MANAGER USER ID
Admin
PLEASE ENTER THE MANAGER PASSWORD
510y
1
"Doesn't exist!!!"
whereas the employee number 1 and user id Admin and password 510y does exist!. and it echoes the value back to be 1 but not comparing it right!
Can someone please tell me where am i doing wrong?
Thanks
i am using ksh scripts and db2. i need to check in my database if a particular user exists,
echo "PLEASE ENTER THE EMPLOYEE NUMBER"
read enumm
echo "PLEASE ENTER THE MANAGER USER ID"
read uid
echo "PLEASE ENTER THE MANAGER PASSWORD"
read pswd
. db2init
QYE=`db2 -x "select count(*) from manUser where EMPLOYEE#=$enumm and USERID='$uid' and PASSWORD='$pswd'"`
echo "$QYE"
if [[ $QYE = 1 ]]
then
echo "existssss"
else
echo "doesn't exist"
the output is
PLEASE ENTER THE EMPLOYEE NUMBER
1
PLEASE ENTER THE MANAGER USER ID
Admin
PLEASE ENTER THE MANAGER PASSWORD
510y
1
"Doesn't exist!!!"
whereas the employee number 1 and user id Admin and password 510y does exist!. and it echoes the value back to be 1 but not comparing it right!
Can someone please tell me where am i doing wrong?
Thanks