Quantcast
Channel: PL/pgSQL SELECT into an array - Stack Overflow
Browsing all 4 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

PL/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
Browsing all 4 articles
Browse latest View live




Latest Images