-
1. Re: FOR EACH ROW procedure for delete
rareddy Mar 19, 2013 10:28 AM (in response to jane_lj)I believe the default "delete" procedure works the way you are saying. However if override that, then it up to your transformation how to manage the range of deletes.
-
2. Re: FOR EACH ROW procedure for delete
jane_lj Mar 19, 2013 10:40 AM (in response to rareddy)Thanks, Ramesh. It's good to know my understanding is correct.
We didnt' override it, and no need to do it. Can you think out any reason that doesn't take the WHERE condition?
We are using Teiid Designer 8.0 and Teiid 8.3. Any conflict between this two versions?
Thanks again.
-
3. Re: FOR EACH ROW procedure for delete
shawkins Mar 19, 2013 11:00 AM (in response to jane_lj)1 of 1 people found this helpfulJust to recap, when you use a for each row trigger, the trigger body will be executed for each row and you must define the trigger in such a way that only affects the row(s) that you want. So in your example above having a for each row trigger with a delete without a where clause will delete all rows for every row affected by the view delete - which is obviously not what you want.
As Ramesh says if the view supports the notion of being inherently updatable, then Teiid should figure out the appropriate delete action for you without you needing to define a for each row trigger.
> Can you think out any reason that doesn't take the WHERE condition?
Can you describe this more fully?
-
4. Re: FOR EACH ROW procedure for delete
jane_lj Mar 19, 2013 2:41 PM (in response to shawkins)Steven,
Thank you very much for your reply. Your explanation is helpful for me.
You made me clear now, so for my case, I can just use the default DELETE tab, even no need to do anything for that tab.
Now I can understand Ramesh's comments too.
Before read your explanation, I thought I have to customized each tab now since I customized INSERT tab. Actually I don't need.
So now, for UPDATE, I do need to write FOR EACH ROW to override it, because I need to do some convert for some columns between View model and Source model.
If I only want to update some rows which satisfy WHERE condition, how should I give those condition in procedure to take care of all cases, my headache is I don't know what kinds of condiion user will give when i write procedure.
Thanks again.