Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: suggestions for maintaining master/child task list
On Mon, 02 May 2005 16:51:06 GMT, "Jack Addington"
<jaddington_at_shaw.ca> wrote:
>My guess is this is not a new chore and there are some good solutions out
>there. Right now I am thinking of something along the lines of
>
>1) On RowTrigger capture task_id / parent_task_id to tmp table
>2) On StatementTrigger process all tasks in tmp table and do the math.
No need for a temp table
issue 2 can be resolved by one update statement
update <...parent>
set flagged = 'N'
where not exists
(select alll unflagged children)
issue 1 can definitely be resolved by a hierarchical select in embedded in a cursor for loop. But depending on version (which you of course don't mention), you would think it would be possible to update an inline view listing all the siblings that have to be updated.
-- Sybrand Bakker, Senior Oracle DBAReceived on Mon May 02 2005 - 12:54:09 CDT