2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

Can't alter password

Am trying to alter the password of a user in plsql:

DECLARE

BEGIN

ALTER USER BOB IDENTIFIED BY PASS123;

END;

I keep getting the error when I create it and cannot make it out what it wrong:

ORA-06550: line 4, column 1: PLS-00103: Encountered the symbol "ALTER" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge

 

userimage

Only dynamic SQL can execute the following types of statements within PL/SQL program units:

Data definition language (DDL) statements such as CREATE, DROP, GRANT, and REVOKE

Session control language (SCL) statements such as ALTER SESSION and SET ROLE

The TABLE clause in the SELECT statem


DECLARE

BEGIN

EXECUTE IMMEDIATE 'ALTER USER BOB IDENTIFIED BY PASS123';

END;

 

Answer is