Explicit Cursor

PHOTO EMBED

Thu Sep 23 2021 00:23:58 GMT+0000 (UTC)

Saved by @kaveen

DECLARE
	CURSOR stock_cur IS
    	SELECT c.address,c.salary
		FROM customers c;
	stock_rec stock_cur%rowtype;
BEGIN
	IF NOT stock_cur%ISOPEN THEN
    	OPEN stock_cur;
	END IF;
	LOOP
    	FETCH stock_cur INTO stock_rec;
		EXIT WHEN stock_cur%NOTFOUND;
		dbms_output.put_line('Address ' || stock_rec.address || ' - Current Salary : ' || stock_rec.salary);
	END LOOP;
	CLOSE stock_cur;
END;
content_copyCOPY