Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute immediate

orauser34Jun 1 2009 — edited Jun 2 2009
Hi,

I want to execute ALTER USER <USERNAME> IDENTIFIED BY <PASSWORD> in PLSQL block.

I tried to use execute immediate as mentioned below
DECLARE
cursor c_users IS
SELECT username
FROM xyz;
....
....
BEGIN
FOR rc_users IN c_users
LOOP
....
....
EXECUTE immediate 'ALTER USER :1 IDENTIFIED BY :2'
using r_users.username , v_actual_password;

END LOOP;
END;

I am not able to execute this block and get an error as stated below

ERROR at line 1:
ORA-01935: missing user or role name
ORA-06512: at line 31

Could someone please advise where I might be going wrong.
Thanks in advance.
This post has been answered by SeánMacGC on Jun 2 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2009
Added on Jun 1 2009
9 comments
1,271 views