I created this function and it works fine except when a null value or a bad data type (like character data) is passed to it. I have looked all over the place in documentation, but must have missed all the right places. Any hints?
create or replace function vendor_ocn (get_vendor_id in rpt_ds1_cnt_cat.vendor_id%type) return varchar2 is
v_ocn varchar2(3);
begin
select OCN into v_ocn from rpt_ds1_vend_ocn where vendor_id = get_vendor_id;
return v_ocn;
exception
when others then
return 'XXX';
end;
-----
I want it to return 'XXX' if a null value or any bad data is passed, not only if there is no data returned from the SELECT statement, which now works fine.
Message was edited by:
duanecwilson