We have several tables with a primary key composed by more that one field,in the datasource definition is possible to set only one field as primary key, this cause an error when docommit after a change in a datagrid. Is possible add a custom update/insert/merge statement to a datasource to solve the problem? Regards
This question is marked "community wiki".
asked 15 Feb '13, 11:08
You can build a view on top of these tables and concatenate the PK columns in your table in one column in the view. Something like:
select PK1||'#'||PK2||'#'||PK3 PKComposite from mytable
Then you can use this view as the base of your datasource definition.
To update the table with the multiple primary keys, you can use an instead of trigger in your view where you parse the PKComposite column and update the columns PK1, PK2, PK3.
Hope this helps. Yalim
answered 15 Feb '13, 11:14
Yalim K. Gerger ♦♦