postgresql - 用 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'
问题是没有插入任何东西!非常感谢!
解决方案
推荐阅读
- virtual-memory - 虚拟内存使用
- react-native - 在 React Navigation TabNavigator 中动态设置 initialRouteName
- html - Div 高度不包含 IE 中的内容
- java - java子字符串没有按预期工作
- javascript - “类型错误:
不是构造函数”在 npm 包的 index.js 中导出后 - c++ - c ++如何将对象指针发送到函数(指针列表排序)
- c# - C# 将字节数组拆分为单独的块并获取块数
- javascript - 将文件从驱动器 F 复制到 C:\program files 中的所有文件夹
- django - Django 应用程序,Django 表单
- oracle - PL/SQL 异常 ORA-06511 游标已打开