Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE
- TYPE t_country_names IS TABLE OF
- wf_countries.country_name%TYPE
- INDEX BY BINARY_INTEGER;
- v_country_names t_country_names;
- CURSOR country_curs IS
- SELECT country_id, country_name
- FROM wf_countries
- WHERE region_id = 5
- ORDER BY country_id;
- v_country_rec country_curs%ROWTYPE;
- BEGIN
- OPEN country_curs;
- LOOP
- FETCH country_curs INTO v_country_rec;
- EXIT WHEN country_curs%NOTFOUND;
- v_country_names(v_country_rec.country_id) :=
- v_country_rec.country_name;
- END LOOP;
- CLOSE country_curs;
- FOR i IN v_country_names.FIRST .. v_country_names.LAST
- LOOP
- IF v_country_names.EXISTS(i) THEN
- DBMS_OUTPUT.PUT_LINE(i || ' ' || v_country_names(i));
- END IF;
- END LOOP;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement