By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

update multiple cols in trigger

P: 3
Hi, i need a help i have a trigger that fires on insert and cols function X,
in function X a need to update 3 columns of a table like
col1 = (select a from table where id = NEW.ID),
col2 = (select b from table where id = NEW.ID),
col3 = (select c from table where id = NEW.ID)
i wondering is there some posibility to update all this cols with 1 select statment so that the select a,b,c will run only 1 time instade of 3 times.
somthing like select a,b,c and put those values in variable and update cols with those variables.??

thanks
Dec 28 '06 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 534
This may be helpful to you:
http://www.postgresql.org/docs/8.2/static/rules-update.html
Dec 29 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.