1 of 1 people found this helpful
See this documentation Update Procedures - Teiid 8.7 (draft) - Project Documentation Editor
You need to be using "instead of trigger" BNF for SQL Grammar - Teiid 8.7 (draft) - Project Documentation Editor
Thank you for the reply. IAnother question is, In the custom delete that I write, how do we retrieve which column is mentioned in the WHERE clause.
If the user query is ,
delete from myView where col1='xyz'
Now for this delete I have to write a custom delete query which deletes records from 3 physical tables.But how do I know what is the criteria mentioned by the user?
Thanks in Advance!
> how do we retrieve which column is mentioned in the WHERE clause
You don't directly. Instead your procedure body is invoked FOR EACH ROW affected by the delete. The currently affected row can be identified by using the "OLD" group variables. For example something like:
FOR EACH ROW
DELETE FROM source1.tbl WHERE pkCol = "OLD".pkCol;