Is there a better way to check if an array parameter has any record with "Y" or not?
I have a user who submits HTML form to this procedure. If the array does not have any flag with "Y" then i want to raise an exception.
I would like to do first thing before any processing (saving records).
is ther a better way?
PROCEDURE SAVE_ORDER (
p_ord_date IN VARCHAR2 DEFAULT NULL,
p_stockno IN TYPES.ARRAY DEFAULT TYPES.EMPTY_ARRAY,
p_flag IN TYPES.ARRAY DEFAULT TYPES.EMPTY_ARRAY)
records_found boolean default false;
I need to check if there are any records submitted with flag set to "Y".
If there are no records, raise an exception with alert that no records are eligible.
FOR i IN 1..p_stockno.COUNT
IF p_flag(i) = 'Y' THEN
records_found := TRUE;
IF (records_found := FALSE) THEN