Last active
December 15, 2015 05:59
-
-
Save mucar/5213145 to your computer and use it in GitHub Desktop.
Using PL/SQL Cursors with Parameters
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 | |
--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