Oracle Error Message
PLS-00170: the SQL statement in an OPEN statement or FOR loop must be a SELECT
Reason for the Error
An OPEN cursor statement or cursor FOR loop can only invoke a SELECT statement, not an UPDATE, INSERT or DELETE.
Solution
Use only SELECT statements in OPEN or cursor FOR loops