declare
cursor abc is
select USER_NAME from dba_users;
begin
for i in abc
loop
select status
into person_status
from dba_users
where USER_NAME := i;
insert status into table_1;
commit;
end loop;
end;
/
It's giving error as below:
select status into person_status from dba_users where USER_NAME := i;
ERROR at line 18:
ORA-06550: line 18, column 77:
PL/SQL: ORA-00920: invalid relational operator
ORA-06550: line 18, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 19, column 82:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 19, column 1:
PL/SQL: SQL Statement ignored
Can some one help me to pass for loop variable to where condition of select statement?
Thanks.