--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
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter