我有以下功能可以正常工作,但我不确定它是否在数组中存储任何内容。
DECLARE
_r record;
point character varying[] := '{}';
i int := 0;
BEGIN
FOR _r IN EXECUTE ' SELECT a.'|| quote_ident(column_name) || ' AS point
FROM ' || quote_ident (table_name) ||' AS a'
LOOP
point[i] = _r;
i = i+1;
END LOOP;
RETURN point;
END;
我所追求的是拥有一个数组,我可以从 javascript 端遍历并读取存储在数组中的每个值。这是正确的做法吗?