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

Jorge%20Alonso's gravatar image

Jorge Alonso
113
accept rate: 0%


Hi Jorge,

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

link

answered 15 Feb '13, 11:14

Yalim%20K.%20Gerger's gravatar image

Yalim K. Gerger ♦♦
1914
accept rate: 20%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×64

Asked: 15 Feb '13, 11:08

Seen: 1,465 times

Last updated: 15 Feb '13, 11:14


© Copyright Gerger 2017