Skip to content

Instantly share code, notes, and snippets.

@JubbaSmail
Created December 22, 2014 20:45
Show Gist options
  • Save JubbaSmail/726d7b0f87e0e5955ba4 to your computer and use it in GitHub Desktop.
Save JubbaSmail/726d7b0f87e0e5955ba4 to your computer and use it in GitHub Desktop.
declare
CURSOR x(g varchar2 ) is
select cust_first_name,cust_last_name,cust_email,income_level from customers
where gender=g;
cust_row x %rowtype;
begin
--open
open x('F');
--fetch (loop)
LOOP
fetch x into cust_row;
exit when x %NOTFOUND OR x%rowcount > 10;
dbms_output.put_line(x%rowcount || ' '||
cust_row.cust_first_name || ' '||
cust_row.income_level );
END LOOP;
--close
close x;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment