SELECT id, name, address FROM customers; BEGIN OPEN c_customers; LOOP FETCH c_customers into c_id, c_name, c_addr; dbms_output. put_line(c_id|| ' ' || c_name|| ' ' || c_addr); EXIT WHEN c_customers%notfound; END LOOP; CLOSE c_customers; END; / Records Table-Based Records DECLARE customer_rec customers%rowtype; BEGIN SELECT * into customer_rec FROM customers WHERE id = 5; dbms_output. put_line('Customer ID: ' || customer_rec. id); dbms_output. put_line('Customer Name: ' || customer_rec. name); dbms_output. put_line('Customer Address: ' || customer_rec. address);
SELECT id, name, address FROM customers; BEGIN OPEN c_customers; LOOP FETCH c_customers into c_id, c_name, c_addr; dbms_output. put_line(c_id|| ' ' || c_name|| ' ' || c_addr); EXIT WHEN c_customers%notfound; END LOOP; CLOSE c_customers; END; / Records Table-Based Records DECLARE customer_rec customers%rowtype; BEGIN SELECT * into customer_rec FROM customers WHERE id = 5; dbms_output. put_line('Customer ID: ' || customer_rec. id); dbms_output. put_line('Customer Name: ' || customer_rec. name); dbms_output. put_line('Customer Address: ' || customer_rec. address);
pl-sql.docx