I have been using view datasources to populate a grid and then i clicked on it to take me to a page that has header (Master) with a Detail. The detail is a grid of another table that i can add extra rows. When i do a docommit it says that it can not update the view datasource. Please let me know how i can use views and tables. Also on the view datasource you can click on the DML permissions the update delete and insert. Is that possible since its a view? Does it update directly the main table?

asked 07 Feb '14, 02:03

chris2014's gravatar image

chris2014
115
accept rate: 0%


This is the exact error i got

Error while committing Datasource "PROJECTS_V1": ORA-01779: cannot modify a column which maps to a non key-preserved table

link

answered 07 Feb '14, 02:22

chris2014's gravatar image

chris2014
115
accept rate: 0%

Ahhh, it seems like your view is not updatable. Try issuing an update (or insert) statement to the view from SQL PLus. You'll get the same error. If you need that view to be updatable, you either need to change its query so that it becomes a key preserved view or write instead of triggers for the view.

(07 Feb '14, 02:32) Yalim ♦♦

Hi Chris,

A view can be updatable. Not every view is updatable. It depends on the query of the view. If Oracle can figure out the base table of the view, it will allow you to update the columns coming from the base table. There is a lot of information about updatable views on the internet. Here is a few I can suggest: http://docs.oracle.com/cd/E17952_01/refman-5.6-en/view-updatability.html http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5226026422731 http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:548422757486

In Formspider, for a datasource definition to be updatable, you need to check one or more DML permission (as you've correctly noticed) and you need to specify a Primary Key. Moreover, if your view is updatable but it has non-updatable columns, in the data source definition dialog, go to the tab for each attribute that you do not want to include into an Update (and Insert) and uncheck the updatable checkbox.

Kind Regards,
Yalim

link

answered 07 Feb '14, 02:27

Yalim's gravatar image

Yalim ♦♦
2.8k5
accept rate: 22%

Thanks Yalim for your answer.

I used also api_datasource.docommit(datasource) to do a commit directly on the detail.

link

answered 07 Feb '14, 02:34

chris2014's gravatar image

chris2014
115
accept rate: 0%

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:

×6

Asked: 07 Feb '14, 02:03

Seen: 1,652 times

Last updated: 07 Feb '14, 02:34


© Copyright Gerger 2017