When executing an Oracle Apex onDemand procedure, I get an error: ORA-01403: no data found. I've researched this for 4 days and still can't get it to work.
- I created a select list
P1_PLANTSand a text fieldP1_LIGHT_REQ In the custom attributes field of
P1_PLANTSI enteredonchange="getLightRequirements(this, 'P1_LIGHT_REQ')";In the HTML Page Header I entered the following JavaScript which will call an onDemand process.
function getLightRequirements( pThis , pLightReq){ alert('In getLightRequirements\nThis.value is '+pThis.value+'\npLightReq is '+pLightReq); var ajaxRequest = new htmldb_Get(null,null, 'APPLICATION_PROCESS=getLightRequirements'); ajaxRequest.add( 'P1_PLANTS' , pThis.value); var ajaxResult = ajaxRequest.get(); alert('ajaxResult is '+ajaxResult); }Below is the onDemand process
declare light_req varchar2(20); P1_PLANTS number; begin select LIGHT_REQUIREMENTS into light_req from PLANTS where PLANT_ID = P1_PLANTS; htp.prn( light_req ); end;
When I choose a plant, I get my alert message showing that all parameter values are as expected and the error shown below.
<html><body><h1>Error occurred while painting error page: ORA-01403: no data found</h1></body></html>
Additionally, it doesn’t populate the ‘Light Requirements’ text field with the error message. (Although the text field DID get populated in the past.) The Session State Protection for P1_LIGHT_REQ is ‘unrestricted’.
If I execute the onDemand process in the Apex SQL Workshop, hard coding a value for P1_PLANTS, the query runs fine.
If I minimize the onDemand process to the code shown below, I still get the no data found error.
begin
htp.prn( light_req );
end;