public.iterate
Blocks | Loops | Branches | Block Coverage | Loop Coverage | Branch Coverage | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | 1 | 2 |
|
|
|
CREATE FUNCTION public.iterate ( IN items anyarray ) RETURNS SETOF anyelement VOLATILE | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | declare arrayMinIndex integer := array_lower(items, 1); arrayMaxIndex integer := array_upper(items, 1); loopIndex integer; begin if arrayMinIndex is null then return; end if; for loopIndex in arrayMinIndex .. arrayMaxIndex loop if items[loopIndex] is not null then return next items[loopIndex]; end if; end loop; end; |