Question

write a pl/sql block to display the countr name and the area of each country in...

write a pl/sql block to display the countr name and the area of each country in each chosen region. the region_id should be passed to the cursor as a parameter. test your block using the two region_id: 5(south America) and 30(eastern Asia). do not use a cursor for loop.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:----------

DECLARE
CURSOR c_country(p_region_id NUMBER) IS SELECT country_name, area
FROM countries
WHERE region_id = p_region_id;
v_country_record c_country%ROWTYPE;

BEGIN
OPEN c_country(5);
LOOP
FETCH c_country INTO v_country_record;
EXIT WHEN c_country%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(v_country_record.country_name||' '||v_country_record.area);
END LOOP;
CLOSE c_country;
END;

Add a comment
Know the answer?
Add Answer to:
write a pl/sql block to display the countr name and the area of each country in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT