Yes, but you introduce a security problem by encoding the password in a file - which is no big deal if you require the user to change password on first login, but may be a big deal if everyone knows what the initial password is.
create or replace procedure change_password (p_new_password varchar2)
is
begin
execute immediate 'alter user '||user||' identified by '||p_new_password;
end;
/
quote:
--------------------------------------------------------------------------------
Originally posted by Raminder
DDL commands are not allowed directly into a stored procedure.
--------------------------------------------------------------------------------
Really? Do you mean not at all, or only if you use something like execute_immediate, dbms_sql, or something along those lines?
What I meant was direct DDL sql. You can use dynamic sql, though.
Bookmarks