User-defined records

Phones table

PHONE_ID PHONE_NAME PRICE
1 Galaxy Note Edge 700
2 N910 Galaxy Note 4 600
3 Galaxy S5 Duos 4G 500
4 iPhone 5S 600
5 iPhone 6 Plus 900

User-defined records

DECLARE
	TYPE rec_phones IS RECORD (
		 id  NUMBER(9),
		 name VARCHAR2(100),
		 price NUMBER);
	my_phones rec_phones;
BEGIN
	SELECT PHONE_ID, PHONE_NAME, PRICE 
	INTO my_phones 
	FROM phones WHERE price=900;
	DBMS_OUTPUT.PUT_LINE
	('Id: '||my_phones.id||' Name: '||my_phones.name||' Price: '||my_phones.price);
END;
/

Output

Id: 5 Name: iPhone 6 Plus Price: 900