what if a function doesn't return a value, and expected to hang.
610112Dec 21 2007 — edited Dec 24 2007Hi, i'm using D2K, 6i forms.
i've a function something like this:
/* Function returns current slno for a transaction.
-----------------------------------------------------------------
create or replace function gen_auto_slno_fn
(doc_vr varchar2,
branch_vr varchar2)
return varchar IS
genslno VARCHAR2(15) ;
BEGIN
BEGIN
SELECT lpad((nvl(SLNO,0)+1),5,0)
INTO genslno
FROM GEN_SLNO
WHERE doc_name = doc_vr
AND BRANCH_CODE=branch_vr;
return(genslno);
EXCEPTION
WHEN no_data_found then
Dbms_output.put_line('No data found in General Serial number for '||doc_vr);
raise_application_error(-20100,sqlerrm);
END;
END;
-----------------------------------------------
My problem is:
suppose if such branch_code does not exist, then
it will go exception part.
I was expecting the 'No data ...error message ' in my forms.
but Instead of that a message such as 'Unhandled exception occurs.
I also tried returning a value like :
EXCEPTION
WHEN no_data_found then
Dbms_output.put_line('No data found in General Serial number for '||doc_vr);
return('ERROR');
--raise_application_error(-20100,sqlerrm);
END;
It was working then.
My question is: how do I display the whole error message on my form and raise form_trigger_failure ?
( also the one in the subject line!)
Message was edited by:
abhijithdev