Skip to content

Instantly share code, notes, and snippets.

@mucar
Last active December 15, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mucar/5213145 to your computer and use it in GitHub Desktop.
Save mucar/5213145 to your computer and use it in GitHub Desktop.
Using PL/SQL Cursors with Parameters
declare
--1 = 1 yerine 1 = 0 yazarak aşağıdaki if bloğuna
--girip girmediğini de gözlemleyebilirsiniz.
cursor c_test(p_test number) is
select 1, 2, 3, p_test from dual where 1 = 1;
v_a number(3);
v_b number(3);
v_c number(3);
v_d number(3);
begin
open c_test(4);
fetch c_test into v_a, v_b, v_c, v_d;
if c_test%notfound then
v_a := 0; v_b := 0; v_c := 0; v_d := 0;
end if;
close c_test;
dbms_output.put_line('a = ' || v_a || ', b = ' || v_b ||
', c = ' || v_c || ', d = ' || v_d);
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment