Subject Trigger Syntax
In order to improve performance on a query, I would like to add a trigger to
a table to automatically update a 'disply' field with some values. The
values would look like this:


And are based on the number of related resources that are allocated to a
slot. My table structure looks kinda like this:


(but itÂ’s a bit more complex in real life). Each resource has Initials, and
this is what I want to show in the XX, YY, ZZ field. In order to do this, I
believe I will need a small stored procedure that can be called from within
a trigger, that will select all of the allocated resources, and then loop
through the rows returned, extracting the Initials and creating a string
variable, seperated by commas for display.

I can see the syntax for a WHILE loop in PSQL, however how do you associate
this with the number of rows returned from a SELECT statement? I need to
loop through each row returned and add to the string variable I'm

All pointers greatly appreciated.


Myles Wakeham
Director of Engineering
Tech Solutions US, Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440