这是我的函数声明和正文的一部分:
CREATE OR REPLACE FUNCTION access_update()
RETURNS void AS $$
DECLARE team_ids bigint[];
BEGIN
SELECT INTO team_ids "team_id" FROM "tmp_team_list";
UPDATE "team_prsnl"
SET "updt_dt_tm" = NOW(), "last_access_dt_tm" = NOW()
WHERE "team_id" IN team_ids;
END; $$ LANGUAGE plpgsql;
我想team_ids
成为一个整数数组,然后可以在UPDATE
语句中使用。这个函数给我这样的错误:
psql:functions.sql:62: ERROR: syntax error at or near "team_ids"
LINE 13: AND "team_id" IN team_ids;