Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE PROCEDURE Ranking
- (n IN number)
- RETURN number
- IS
- nrows number;
- CURSOR cursor1
- IS
- SELECT wartosc
- FROM tab3
- ORDER BY wartosc DESC;
- BEGIN
- dbms_output.put_line('Ranking:');
- OPEN cursor1;
- LOOP
- FETCH cursor1 INTO nrows;
- EXIT WHEN cursor1%NOTFOUND OR cursor1%NOTFOUND IS NULL;
- dbms_output.put_line(nrows);
- END LOOP;
- CLOSE cursor1;
- EXCEPTION
- WHEN OTHERS THEN
- raise_application_error(-20001,'An error was encountered -
- '||SQLCODE||' -ERROR- '||SQLERRM);
- END;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement