I’m trying to pass associative array as argument to a procedure. When I’m compiling I’m getting error
PL/SQL: Statement ignored PLS-00382: expression is of wrong type
Could anyone please tell me what is wrong in my code.
proceudre main() is_net_trad_found NUMBER; is_net_compensated NUMBER; net_trade_index NUMBER; iLoop NUMBER; TYPE net_trade_rec IS RECORD ( net_trade_tag NUMBER(10), net_comp_status VARCHAR2(1) ); TYPE trade_rec IS TABLE OF net_trade_rec INDEX BY BINARY_INTEGER; net_trade_obj trade_rec; /* nested proceudre */ PROCEDURE is_trade_exist(in_net_trade_obj trade_rec, in_loc_netg_trad_tag IN NUMBER, in_net_trad_found OUT VARCHAR2, in_net_compensated OUT VARCHAR2) IS loc_loop NUMBER; ern CONSTANT POSITIVE := 059; BEGIN in_net_trad_found := 'N'; in_net_compensated := 'N'; loc_loop := in_net_trade_obj.FIRST; WHILE (loc_loop IS NOT NULL) LOOP IF in_net_trade_obj(loc_loop).net_trade_tag = in_loc_netg_trad_tag THEN in_net_trad_found := 'Y'; IF in_net_trade_obj(loc_loop).net_comp_status = 'Y' THEN in_net_compensated := 'Y'; END IF; EXIT; END IF; loc_loop := in_net_trade_obj.NEXT(loc_loop); END LOOP; EXCEPTION WHEN OTHERS THEN raise_application_error(-(20000+ern),SQLERRM); END; BEGIN net_trade_index := net_trade_index+1; net_trade_obj(net_trade_index).net_trade_tag := loc_netg_trad_tag; net_trade_obj(net_trade_index).net_comp_status := is_net_compensated; iLoop := net_trade_obj.FIRST; IF iLoop THEN is_trade_exist(net_trade_obj, loc_netg_trad_tag, is_net_trad_found, is_net_compensated); END IF; END;
TYPE is not declared globally. the above main procedure is inside a package.