I am trying to create a new data window by sourcing an Oracle Stored procedure. The stored procedure has compiled and been tested using Oracle SQL Developer. It runs fine. However when i try to create a data window it throws a Date Error before i can even see the created data window to enter retrieval arguments.
We are using Oracle 12c and PB 2017-2
create or replace
PROCEDURE effective_date_report(from_eff_date in date,
thru_eff_date in date,
v_cursor out sys_refcursor)
as
BEGIN
OPEN v_cursor FOR
select a.spa_nbr,
a.spa_type_cd,
a.spa_sub_type_cd,
a.spa_title,
a.spa_eff_date,
a.spa_qtr,
a.spa_year,
f.spa_status_cd as "spa_status" ,
d.spa_status_date,
f.spa_location_cd,
e.spa_cont_form,
c.spa_fed_dols as "spa_fi_gross_sfy_dols",
b.prem_contact_name as "spa_prog_contact_name",
b.pcvg_contact_name as "spa_cms_contact_name",
b.spau_contact_name as "spa_spau_contact_name"
from state_plan.spa_hdr a,
state_plan.spa_contact_leads b,
state_plan.spa_sum_fi_fed_dols c,
state_plan.spa_max_status_date d,
state_plan.spa_upl_cont e,
state_plan.max_status_data f
where a.spa_eff_date >= from_eff_date
and a.spa_eff_date <= thru_eff_date
and a.spa_nbr not in(select spa_nbr from state_plan.finalized_spas)
and a.spa_nbr not in(select spa_nbr from state_plan.spas_on_hold)
and a.spa_nbr = b.spa_nbr
and a.spa_nbr = c.spa_nbr
and a.spa_nbr = d.spa_nbr
and a.spa_nbr = e.spa_nbr
and a.spa_nbr = f.spa_nbr
and d.spa_status_date = f.spa_status_date;
RETURN;
EXCEPTION WHEN OTHERS THEN utils.handleerror(SQLCODE,SQLERRM);
END;
Can anyone give me a clue? Thanks