Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

check if username and password passed are valid?

Allen SandiegoApr 8 2009 — edited Apr 8 2009
hi,

i've been asked to create a shell script that accepts a username and password which i then need to check against the database..

but the script won't be running any sql commands.. it will run another script that also accepts a username and password.

what i have so far
sqlplus -s $ora_user_pass << EOF
set echo off
set heading off
select sysdate from dual;
exit
EOF
ret_code=$?

if [ "$ret_code" -gt 0 ]; then
  echo "Invalid username and/or password"
  exit
else
....
this works ok but it's a little dirty.. when the username and password are incorrect it shows a bunch of errors instead of the displaying "Invalid username and/or password".. this is coming from the sqlplus.

i'd appreciate any other suggestions.

thanks
allen
This post has been answered by 506787 on Apr 8 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2009
Added on Apr 8 2009
9 comments
2,636 views