Oracle change of Password

muse1982
muse1982 used Ask the Experts™
on
I need a script that will connect to an oracle data locally by running a batch file and change  a specific uses password.

I need to be able to extract a  field from a database and use it in the password.

I have  created the below , although I don'Y think it is right can you please advised what I need to do to this.




select to_char(locationcode) dcol from resort;

spool c:\temp\&locationcode.LOG_PCR_GLOBAL_ALERTS.log

update application$_user
set app_password='(locationcode)0777'    
where app_user='SUPERVISOR';





spool c:\temp\&locationcode.LOG_PCR_GLOBAL_ALERTS.log
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
- try the following:
SQL> column tm new_value dcol noprint;

SQL> select to_char(locationcode) || '0777' dcol from resort;

SQL> spool c:\temp\&dcol.LOG_PCR_GLOBAL_ALERTS.log

SQL> update application$_user set app_password= '&dcol' where app_user='SUPERVISOR';

SQL> spool off


OR


SQL> column tm new_value dcol noprint;

SQL> select to_char(locationcode) dcol from resort;

SQL> spool c:\temp\&dcol.LOG_PCR_GLOBAL_ALERTS.log

SQL> update application$_user set app_password= '&dcol' || '0777' where app_user='SUPERVISOR';

SQL> spool off

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial