执行pgsql抱怨循环时的问题

问题描述

create or replace function f() RETURNS void AS 

declare
   tableArray text[] := '{"ADDRESS","CONSISTENCY_CHECK","DEPARTMENT_SUPERVISION"}';
   tableName CHARACTER VARYING;
   value INTEGER ;
   
BEGIN
 FOREACH  tableName IN ARRAY tableArray 
 LOOP   
     select user_id from tableName where user_id=2631;
       if found then
         update tableName set user_id=2651 where user_id=2631;
         delete from tableName where user_id=2631;
  END loop;
end;

这是我尝试执行pgplsql时遇到的错误:ERROR syntax error at or near "loop"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)