user2924127
user2924127

Reputation: 6242

ORA-00922: missing or invalid option on changing the user password

This plsql is returning the error:

ORA-00922: missing or invalid option

DECLARE
BEGIN

EXECUTE IMMEDIATE 'ALTER USER upper(:USERNAME) IDENTIFIED BY :NEW_PASSWORD REPLACE :OLD_PASSWORD';

END;

Upvotes: 0

Views: 14026

Answers (1)

Husqvik
Husqvik

Reputation: 5809

DDL statements where ALTER belongs to cannot contain bind variables - :USERNAME, :NEW_PASSWORD, :OLD_PASSWORD

Use

EXECUTE IMMEDIATE 'ALTER USER ' || upper(:USERNAME) || ' IDENTIFIED BY ' || :NEW_PASSWORD || ' REPLACE ' || :OLD_PASSWORD;

instead.

Upvotes: 4

Related Questions