Created
June 17, 2019 12:28
-
-
Save EvgenJin/2b5cdab5497049159759a0ffffd414f1 to your computer and use it in GitHub Desktop.
pl/sql cursor
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
create or replace package test_pkg is | |
cursor c_zaj(p#obj_id number ) is | |
select zaj.id | |
, zaj.id_cus | |
, zaj.sum_crd | |
, zaj.targ | |
from exp_zaj zaj | |
where zaj.id = p#obj_id; | |
end; | |
create or replace package body test_pkg is | |
procedure test(p#obj_id number) | |
is | |
r#zaj c_zaj%rowtype; | |
begin | |
open c_zaj(p#obj_id); | |
fetch c_zaj into r#zaj; | |
close c_zaj; | |
end; | |
function test(p#obj_id number) return number is | |
cRes number; | |
r#zaj c_zaj%rowtype; | |
begin | |
test(p#obj_id); | |
return r#zaj.id; | |
end; | |
end test_pkg; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment