Is it possible to use something like this in Postgres? This is the example from PL/SQL what I want to do:
PROCEDURE CREATE_PAYMENT(P_AMOUNT IN NUMBER,
P_INVOICE_LIST IN SIMPLEARRAYTYPE,
P_AMOUNT_LIST IN NUMBER_TABLE -- pass list of amounts
.
.
.)
s_chk_amnt NUMBER;
invoice_list SIMPLEARRAYTYPE;
amount_list NUMBER_TABLE;
BEGIN
-- check if amount list is null or contains zeros
IF p_amount_list IS NOT NULL AND p_amount_list.COUNT <> 0 THEN
FOR r IN p_amount_list.FIRST..p_amount_list.LAST
LOOP
s_chk_amnt := s_chk_amnt + p_amount_list(r);
END LOOP;
END IF;
Can I declare a list of characters and list of numbers as function input parameters?
I have found some examples with FOREACH element
but I don't know how to grab a certain element from number list like in Oracle with p_amount_list(r)
.