"a" is the index variable in a for loop and should not get manually incremented. If left alone it will increment itself. You don't state the error message, but without running the code I'm guessing that that is it. You are also seemingly trying to print out the same query 10 times without changing it. What are you really trying to do, and what error are you getting?
declare
i varchar(200);
begin
for a in 1 .. 10 loop
i := 'select count(*) from messages';
dbms_output.put_line (i);
a := a + 1;
end loop;
END;
this space intentionally left blank
Bookmarks