Using INSTEAD OF Views in Oracle Forms 6i

5 pts.
Tags:
FRM-40602
INSTEAD OF triggers
Oracle development
Oracle Forms 6i
Oracle Views
I have a block in my forms which is based on a view. I have created an instead of trigger on this view tu update certain fields. I would like to update this view through a Forms. I have made the block and the field updatable, but it gives me the following message when I try to write something on the field: "FRM-40602 Cannot insert or update data in a view" Is it possible to update this field through Forms? If yes how can I do that? Many thanks, Ariadne
ASKED: April 8, 2009  7:18 AM
UPDATED: July 30, 2009  2:51 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

by instead of trigger I presume you are refering to a database instead-of-trigger on the view.

It has been some time since I have travelded this specific road withs forms, however, I seem to recall a few things are needed to make dml against a complex view with instead of triggers a reality. There should be no need to write an on-update trigger in your form. Indeed, the reason for a view and instead-of-trigger on that view is so that you do not require additional coding in your form.

1) you need the instead-of-trigger on the view (confirm it is there)

2) you need to change the locking mode in the form for the block based on your view so that it uses the logical key for locking purposes. There is a lock mode setting somewhere in the block properties page, find it, understand the differences and pick the righ tone (I forget at this moment which on it is, try them all if necessary).

3) #2 will involve selecting those fields that map to the business identifier/primary key you want to you use for finding rows. You need to visit each field’s property page and set the appropriate attribute to indicate that is is part of the key used to find rows. It is there on the properties page but not having forms available at the moment I cannot give you the property name. You will have to do a little exploring to find it.

If you do these things, the error should go away and the view become updatable via oracle forms without the need to write any on-update trigger.

Do some testing at the database level first. Make sure you can update the view directly via sqlplus first with the instead-of-trigger before you attempt it in the form. This will ensure that your issue is forms related and not database related. This is an important step because the database will return a similar error to what you have reported if the instead-of-trigger does not exist on the view.

Good luck, Kevin

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following