I am trying to create a validation for a page in an application on oracle apex. Below is the pl/sql function body (returning boolean) I have:
declare v_equipid integer;
begin
SELECT count(*) into v_equipid from equipment
WHERE equipstatus = 'available' and equipID = :P3_EquipID;
if v_equipid = 1 then
return true;
else
return false;
end if;
end;
It is used to check whether the EquipID submitted has equipstatus = 'available'. After I run the application and submit the form, it gives the following error:
Error: Error processing validation.
- is_internal_error: true
- is_common_runtime_error: false
- apex_error_code: APEX.VALIDATION.UNHANDLED_ERROR
- ora_sqlcode: -6502
- ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error ORA-06512: at "APEX_200100.WWV_FLOW_VALIDATION", line 846 ORA-06512: at "APEX_200100.WWV_FLOW_VALIDATION", line 846
- error_backtrace: ORA-06512: at "APEX_200100.WWV_FLOW_VALIDATION", line 846 ORA-06512: at "APEX_200100.WWV_FLOW_VALIDATION", line 846 ORA-06512: at "APEX_200100.WWV_FLOW_VALIDATION", line 1029
I don't know how to fix this and I would appreciate your help. Thank you in advance!