Here's a shorter, though no less ugly, option:
DECLARE CURSOR C IS SELECT val FROM (SELECT LEVEL val FROM dual CONNECT BY LEVEL < 1000) WHERE val IN (105,102,19,17,101,16,106,107); BEGIN FOR R IN C LOOP select * INTO my_rec_type from some_table where value=R.val;
The advantage here (IMO) is that you only need to change the IN list and possibly the limit of the CONNECT BY clause to change your results.
source share