|
Posted by Zvonko on 10/02/49 11:51
"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns97EF7B82C2C9Yazorman@127.0.0.1...
> Zvonko (zvonko_NOSPAM_@velkat.net) writes:
>> I have a interesting problem. I need to write a trigger that wil go
>> off after every sixth row is inserted/updated.
>
> That is not really possible. For starters, a trigger fires once per
> statement, so what if you insert 35 rows in one go?
>
> I think you need to reformulate the requirement. What do you really
> want to achieve?
I realised that this can not be done with trigger. Here is the deal. For one
item you have six rows with different values for column optzalpak. I have to
insert all six rows and then get SUM(optzalpak) for that particular item and
update all six rows with it. And then another six rows for second item.
I did it programatically (Java) but it takes too long to be done, so I am
wondering if I can let the SQL server do the dirty work.
Thanks,
Zvonko
Navigation:
[Reply to this message]
|