PKG_NKW_SRW.SPB
Source Package Body
Parâmetros de relatórios.
create or replace package body pkg_nkw_srw
timestamp '2006-07-07:10:10:10'
is
------------------------------------------------------------------
-- 2006 DataPRO Developers - m@urelio
------------------------------------------------------------------
-- Version: 2.0.2
------------------------------------------------------------------
-- Collections, Records, Variables, Constants, Exceptions, Cursors
------------------------------------------------------------------
------------------------------------------------------------------
---------------------- Private Section ---------------------------
------------------------------------------------------------------
------------------------------------------------------------------
----------------------- Public Section ---------------------------
------------------------------------------------------------------
------------------------------------------------------------------
-- HAS_WCIES
------------------------------------------------------------------
function has_wcies(fv_name in nkw_frmsrw.frm_name%TYPE)
return boolean
is
retval boolean := (FALSE);
begin
begin
declare cursor has_cur is
select 1
from nkw_frmsrw
where (frm_name = upper(fv_name));
i integer(1);
begin
if (not has_cur%ISOPEN) then
open has_cur;
end if;
fetch has_cur into i;
if (has_cur%FOUND) then
retval := (TRUE);
end if;
if (has_cur%ISOPEN) then
close has_cur;
end if;
end;
end;
return retval;
exception
when others then raise;
end has_wcies;
------------------------------------------------------------------
-- GET_WCIES
------------------------------------------------------------------
function get_wcies(fv_name nkw_srw.srw_name%TYPE)
return gt_wcies%TYPE
is
rettab gt_wcies%TYPE;
begin
begin
declare cursor get_cur is
select a.srw_name, a.srw_view, b.srw_item, b.srw_column,
b.srw_datatype, b.srw_label
from nkw_srwcies b, nkw_srw a
where (a.srw_name = upper(fv_name))
and (a.srw_name = b.srw_name)
and (b.srw_parameter = 'Y')
order by b.srw_item;
get_row get_cur%ROWTYPE;
i binary_integer;
begin
if (not get_cur%ISOPEN) then
open get_cur;
end if;
<< get_loop >>
loop
fetch get_cur into get_row;
exit get_loop when (get_cur%NOTFOUND);
i := get_cur%ROWCOUNT;
begin
rettab(i).srw_name := get_row.srw_name;
rettab(i).srw_view := get_row.srw_view;
rettab(i).srw_item := get_row.srw_item;
rettab(i).srw_column := get_row.srw_column;
rettab(i).srw_datatype := get_row.srw_datatype;
rettab(i).srw_label := get_row.srw_label;
end;
end loop get_loop;
if (get_cur%ISOPEN) then
close get_cur;
end if;
end;
end;
return rettab;
exception
when others then raise;
end get_wcies;
end pkg_nkw_srw;
|