Password [message #143469] |
Thu, 20 October 2005 09:34 |
vishal gupta
Messages: 111 Registered: March 2001
|
Senior Member |
|
|
Hi,
I have to create a script which will ask for an password and validate it and if its correct ,then call some procedures ,otherwise display an error.
How can i prompt for an password using script ?
Is it possible that when the user enters the password ,it should be displayed in encypted form(asterisks) ?
Can you suggest some examples or references on this ?
I am using Oracle 9i.
Thanks and Regards,
Vishal
|
|
|
Re: Password [message #143519 is a reply to message #143469] |
Thu, 20 October 2005 13:28 |
edwardstoever
Messages: 12 Registered: February 2005 Location: Pasadena, CA
|
Junior Member |
|
|
rem x.sql
rem
whenever sqlerror exit rollback;
set echo off
prompt "The value entered for the SYSTEM password will not display."
accept system_password char prompt "Enter the password for SYSTEM: " hide
connect system/&&system_password@test
select dbms_random.string('A',100) from dual;
exit
Here is an example of calling that script from the command line:
D:\temp1>sqlplus /nolog @x
SQL*Plus: Release 9.0.1.3.0 - Production on Thu Oct 20 11:18:47 2005
(c) Copyright 2001 Oracle Corporation. All rights reserved.
"The value entered for the SYSTEM password will not display."
Enter the password for SYSTEM:
Connected.
DBMS_RANDOM.STRING('A',100)
--------------------------------------------------------------------------------
VesrnNQUVADGmMXOyMhjEoWoQmGiajqussnGFQdLpwUDdYLcbXYSywTlQyaNwGPNsqNsdAZnJCniMhRr
KeAYgJgIqOUCXsYinhwG
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
With the Partitioning option
JServer Release 9.2.0.5.0 - Production
D:\temp1>
This should work on any OS.
Edward Stoever
http://www.database-expert.com
|
|
|