Is it possible to declare a cursor in the declarations section of a procedure, but populate the cursor in the executable section? I need to add functionality to an existing procedure which will require me to loop over records in a temporary table that is created within the executable section. Cursors are the only way I can think of to access the records one at a time, but then I run into the question of population.

If not, is there another way to do what I need? Suggestions and/or other solutions are much appreciated.