Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How can i lock an user from a package?

Re: How can i lock an user from a package?

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 30 Nov 2004 15:14:42 -0800
Message-ID: <92eeeff0.0411301514.21fd1e3e@posting.google.com>


bakanon_at_yahoo.com (Alvaro G?lvez) wrote in message news:<dce856b.0411301159.7bddae42_at_posting.google.com>...
> Hi
> I need to lock an oracle user from inside a package, so i can't use
> ALTER instruction... If i do
>
> ALTER USER username ACCOUNT LOCK;
>
> it throws the following:
>
> PLS-00103: Encountered the symbol "ALTER" when expecting one of the
> following:
>
> begin declare exit for goto if loop mod null pragma raise
> return select update while

Look up usage for dynamic sql package dbms_sql or execute immediate. You cannot use ALTER inside PLSQL. e.g.

begin

   execute immediate 'alter user blah account lock'; end;
/

Regards
/Rauf Received on Tue Nov 30 2004 - 17:14:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US