Operating System - HP-UX
1828366 Members
2823 Online
109976 Solutions
New Discussion

Need to learn how to pass user/pass as arguments.

 
SOLVED
Go to solution
Mrg_2
Advisor

Re: Need to learn how to pass user/pass as arguments.

Snippet from part 3:

echo "Loading..... " $file
sqlplus -s $ORACLE_USER_ID/$ORACLE_PASSWORD < execute loadnpsg('$file');

So you are saying I should add the Oracle user id and oracle password in this section instead of it looking for them? So it would look like this:

echo "Loading..... " $file
sqlplus -s username/password < execute loadnpsg('$file');

Also for the sudo part you are saying to use #sudo programtoexecute.sh ??

Thanks
Viktor Balogh
Honored Contributor

Re: Need to learn how to pass user/pass as arguments.

sorry for the late answer, the notification didn't work for some reason.

>"Snippet from part 3:

echo "Loading..... " $file
sqlplus -s $ORACLE_USER_ID/$ORACLE_PASSWORD <execute loadnpsg('$file');"

ok, this an interactive script.

>" The reason for the potential switch is >that I am trying to find a possible way to >cron this process nightly."

If you want to have run it from cron you should burn in the username/password and leave interactivity.

"echo "Loading..... " $file
sqlplus -s username/password <execute loadnpsg('$file');"

It is right. Not the sudo way, but you should skip interactivity. In our environment sqlplus don't prompt for the password, but I don't really know it how it was done.
****
Unix operates with beer.
Mrg_2
Advisor

Re: Need to learn how to pass user/pass as arguments.

Got it!

Thanks for all the help.