Cursor-based records

Course table

COURSE_ID NAME PRICE
1 SQL 1 10
2 SQL 2 50
3 HTML5 10

Cursor-based records

DECLARE
	CURSOR c1 IS SELECT * FROM course where price=10;
	course_rec c1%rowtype;
BEGIN
	OPEN c1;
	LOOP
		FETCH c1 into course_rec;
		EXIT WHEN c1%notfound;
		DBMS_OUTPUT.PUT_LINE
		('Id: '||course_rec.COURSE_ID||' Name: '||course_rec.NAME||' Price: '||course_rec.PRICE);
	END LOOP;
	CLOSE c1;
END;
/

Output

Id: 1 Name: SQL 1 Price: 10
Id: 3 Name: HTML5 Price: 10