Record

PHOTO EMBED

Thu Sep 23 2021 01:38:53 GMT+0000 (UTC)

Saved by @kaveen

--example 1

DECLARE 
TYPE customer_type IS RECORD
 (
	
  	customer_name varchar(100),
  	customer_address varchar(2090)
);
customer_rec customer_type;
BEGIN
	select c.name,c.address
	into customer_rec.customer_name,customer_rec.customer_address
	from customers c
    where c.id = 2;

	dbms_output.put_line('Customer name: ' || customer_rec.customer_name);
END


--example 2

DECLARE
customer_rec customers%ROWTYPE;

BEGIN
	
	select c.name,c.address
	INTO customer_rec.name,customer_rec.address
	FROM customers c
    where c.id = 2;

	dbms_output.put_line('Name :' || customer_rec.name)
END
content_copyCOPY