Skip to content

Instantly share code, notes, and snippets.

@JubbaSmail
Created December 22, 2014 22:55
Show Gist options
  • Save JubbaSmail/17c55492014b15489078 to your computer and use it in GitHub Desktop.
Save JubbaSmail/17c55492014b15489078 to your computer and use it in GitHub Desktop.
declare
CURSOR x is
select cust_first_name,cust_last_name from customers;
f_name customers.cust_first_name %type;
l_name customers.cust_last_name %type;
begin
--open
open x;
--fetch (loop)
LOOP
fetch x into f_name,l_name;
exit when x %NOTFOUND OR x%rowcount > 10;
dbms_output.put_line(x%rowcount || ' '||f_name || ' ' || l_name);
END LOOP;
--close
close x;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment