You used a SELECT statement with no INTO clause or a RESULT CURSOR statement within an atomic compound statement.