I want to know if it's posible to do something like this:
CREATE OR REPLACE function my_funct(some_data some_type, array int[]) RETURNS TABLE(code int, desc varchar) LANGUAGE plpgsql as $function$ DECLARE .. BEGIN WHILE some_condition < array.size --i know this doesn't exists LOOP INSERT INTO some_table values(array_data[1]); --I want to insert data from the array as long as it has data END LOOP; RETURN QUERY select 1001, cast ('DONE!' as varchar); END; $function$
i would appreciate any response! thanks!