首页 > 解决方案 > 用 for 选择不同并插入 plpgsql 函数

问题描述

我需要做这个小功能,但它不起作用。它不会给我任何错误,只是不会做我需要的。

CREATE OR REPLACE FUNCTION relleno_masivo() returns void as 
$$
    DECLARE
r sw%rowtype;
nombre text;
BEGIN
    for r in select distinct institucion from sw where fuente='FFMM'
    LOOP
    nombre:= r.institucion;
    PERFORM * FROM inserta_mas_transadas(nombre);
    END LOOP;
END;
$$
LANGUAGE 'plpgsql'

问题是没有插入任何东西!非常感谢!

标签: postgresqlplpgsql

解决方案


推荐阅读