Answer by jian for PL/pgSQL SELECT into an array
a tiny customization based on other answers.If the team_id is a normal int data type. UPDATE team_prsnl p SET updt_dt_tm = now() ,last_access_dt_tm = now() FROM tmp_team_list t WHERE p.team_id =...
View ArticleAnswer by Erwin Brandstetter for PL/pgSQL SELECT into an array
Faster and simpler with a FROM clause in your UPDATE statement:UPDATE team_prsnl pSET updt_dt_tm = now() , last_access_dt_tm = now()FROM tmp_team_list tWHERE p.team_id = t.team_id;That aside, while...
View ArticleAnswer by dsh for PL/pgSQL SELECT into an array
To create an array from a SELECT:# select array( select id from tmp_team_list ) ; ?column? ---------- {1,2}(1 row)The IN operator is documented as taking a subquery for the right-hand operand. For...
View ArticlePL/pgSQL SELECT into an array
Here's my function declaration and part of the body:CREATE OR REPLACE FUNCTION access_update()RETURNS void AS $$DECLARE team_ids bigint[];BEGIN SELECT INTO team_ids "team_id" FROM "tmp_team_list";...
View Article
More Pages to Explore .....