-
1. Re: custom DELETE query instead of the default one (in the transformation editor).
rareddy Apr 10, 2014 4:14 PM (in response to teiiduser)1 of 1 people found this helpfulSee 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
Ramesh..
-
2. Re: custom DELETE query instead of the default one (in the transformation editor).
teiiduser Apr 11, 2014 10:02 AM (in response to rareddy)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.
For example:
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!
-
3. Re: custom DELETE query instead of the default one (in the transformation editor).
shawkins Apr 11, 2014 12:26 PM (in response to teiiduser)> 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
BEGIN ATOMIC
DELETE FROM source1.tbl WHERE pkCol = "OLD".pkCol;
...
END