Created
December 22, 2014 20:37
-
-
Save JubbaSmail/ba2c2f17d6a84ef64a2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
CURSOR x(g varchar2 ) is | |
select customer_id, cust_first_name,cust_last_name,cust_email,income_level from customers | |
where gender=g; | |
cust_row x %rowtype; | |
TYPE table_type is table of number index by BINARY_INTEGER; | |
id_arr table_type; | |
begin | |
--open | |
open x('F'); | |
--fetch (loop) | |
LOOP | |
fetch x into cust_row; | |
exit when x %NOTFOUND OR x%rowcount > 10; | |
id_arr(x%rowcount) := cust_row.customer_id; | |
END LOOP; | |
for j in 1..x%rowcount loop | |
dbms_output.put_line( id_arr(j) ) ; | |
end loop; | |
--close | |
close x; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment