I do not understand the usefulness for the above query. Why would want to do a "select" when user issues a "update"? There are four different transformations you can supply on a view table.
1) select 2) insert 3) update 4) delete
so that you can in turn support CRUD operations. "TRANSLATE CRITERIA" is single command, that converts the user supplied criteria into transformation specific criteria, where you can specify on which command you want to apply this on. Please note that "TRANSLATE CRITERIA" only applicable for 3 & 4. In the case of (1) Teiid query planner will automatically inline the criteria with the provided "select" transformation.
Hope this helps.
The "Supports Updates" check-box will enable you to enter Update/Insert/Delete SQL in the transformation editor. If you have a simple Select SQL statement, Designer will create default SQL for the update queries as a starting point. If your Select SQL is not simple, then you'll have to enter your update SQL from scratch.
Thanks for your replay.
I'm sorry for missing of description of background.
The select transformation of view model table is a union query from different two tables that has same columns.
I execute the above select query to justify which table the record is from?
The whole background is same with the Solution 2 in the my last discussion http://community.jboss.org/message/566899#566899.
And I have read your reply to it. You said that the solution 2 is not fit for my requirement.
By the way, I thought my last discussion is some complicated and long. So I posted this discussion. Sorry for the confusion.
Thanks for your help.
Because the select transformation of view model table is a union query from different two tables that has same columns, I need to write my update SQL from scratch.
After just skimming it, I found it is useful for writing transformation, however maybe it could not help me on my problem of changing the default criteria mapping.
I will read the document you mentiond carefully.
It is good that you are trying multiple things, it is a very valid approach. But in this case you would be doing lot more work about "source_name" stuff and updating based on it, essentially trying replicate what multi-source already provides you.
To clarify, you can do a "select" in the update transformation to fetch a cursor or single value, however you can only use the "TRANSLATE CRITERIA" on the "update/delete" statements.
Thanks for your suggestion.
In fact, this solution was my initial solution. Now I have stopped working on this.