-
I try to
alter user user_name account lock;
alter system kill session 'c_sid, c_serial';
from a procedure get error.
11/3 PLS-00103: Encountered the symbol "ALTER" when expecting one of
the following:
begin declare end exit for goto if loop mod null pragma raise
return select update while
<<
close current delete fetch lock insert open rollback
savepoint set sql commit
I assume I have to use dbms package to do it
Could anyone tell me which dbms package I can use?
thanks
-
Use dynamic sql to issue this command. See http://technet.oracle.com/docs/produ...dynam.htm#8074 for details.
-
You cannot directly execute the DDL from a procedure. The way to do that is
Code:
procedure .... (p_username VARCHAR2(100))IS
v_sql_text VARCHAR2(1000);
BEGIN
v_sql_text := 'ALTER USER '||p_username ||' ACCOUNT LOCK';
EXECUTE IMMEDIATE v_sql_text;
.
:
END;
/
show errors;
Sam
-