PLS-00049: bad bind variable
user5345Mar 14 2011 — edited Mar 26 2011Dear All,
Im trying to create the below function and it is giving me error: PLS-00049: bad bind variable 'P_PERIOD'
create or replace function xxcust_get_targets
(p_division in varchar2, p_vendor in varchar2, p_classification in varchar2,
p_location varchar2, p_type varchar2, p_period varchar2) return number is
l_target_value number;
select sum(decode(to_char(to_date ('01-' || to_char (:p_period)), 'MON'),
'JAN',v_jan, 'FEB',v_feb, 'MAR', v_mar, 'APR', v_apr, 'MAY', v_may, 'JUN', v_jun, 'JUL', v_jul, 'AUG', v_aug,
'SEP', v_sep, 'OCT', v_oct, 'NOV', v_nov, 'DEC', v_dec, 0 ))
into l_target_value
from xxcust_entity_rules xer,
xxcust_entity_targets xet
where xet.combination_set = xer.combination_set
and xer.target_type = 'MARKETING'
and xer.cat_level01 = p_division
and xer.cat_level03 = p_vendor
and xer.cat_level05 = p_classification
and loc_level03 = p_location
and xer.cla_level01 = p_type
and to_date ('01-' || to_char (p_period)) between xet.effective_start_date and xet.effective_end_date;
return l_target_value;
exception
when others then
return 0;
end xxcust_get_targets;
/
show err
Can any one help me in this, im using 10g database.
thnxs