Re: help!: Views in Forms

From: Jerry Alan Braga <jabraga_at_flanagan.ca>
Date: Wed, 26 Sep 2001 08:35:27 -0400
Message-ID: <OYjs7.32153$Z2.460182_at_nnrp1.uunet.ca>


    [Quoted]
  1. if you DML target is the view itself then the view must be 1-1 with the table. You cannot insert/update/delete thru a view of multiple tables.
  2. If you wish to read from a view an update a table then set the DML DataSource to the view, DML Target to the table and set the COUNTRYNAME column to QUERYONLY "YES". This will allow reading from but not insert/updating to.

3.should in your view you not be joining the coutry ID's together, this way you will get a cartesian product or all you allowing the same plant ID in mutiple country ID's ?

4 Being that you calling another form from the first, ensure that you have Refresh turned on in you LOV properties, or you will never see the result of the new country in the LOV. Also by calling another form (unless you specify open_form with session) your transaction scope is for both the caller and calling form. Therefore when you save changes in the called form you will also be saving the pending changes in the caller form. This can also cause problems.

[Quoted] NOTE: I did not think that Forms 6i was certified against 7.3.4 but I could be mistaken.

"dfg" <rebeliscool_at_wowmail.com> wrote in message news:abf50112.0109260211.12e4dc07_at_posting.google.com...
> Hi,
>
> I faced a problem using views in Forms 6i
> Hope somebody can help me to resolve it
>
> I cannot insert records in the view if one of it tables
> got new records.
>
> Suppose I have two tables PLANT and COUNTRY.
> PLANT references COUNTRY:
>
> COUNTRY
> ( ID INTEGER
> NAME VARCHAR2(40));
>
> PLANT
> ( ID INTEGER,
> NAME VARCHAR2(40),
> CID REFERENCES COUNTRY );
>
> I found it useful to create a plant view that contains country name
> instead of country id:
>
> CREATE VIEW VPLANT AS SELECT P.ID, P.NAME, C.ID as CID, C.NAME as
COUNTRYNAME
> FROM PLANT P, COUNTRY C;
>
> Then I create a form that happily displays plants from the view.
> And I'm using LOV to select country when inserting new plant data.
>
> NOW!
> If I have no necessary country in the LOV I use another form to
> create a new country record.
> Then I see the necessary country in the LOV, but cannot insert
> the new record in the view!
>
> With one of the following errors:
> FRM-40502 (in dependant table)
> FRM-40654 (in main table)
>
> Thank you for any suggestion.
>
> I'm using Forms 6i and Oracle 7.3.4
Received on Wed Sep 26 2001 - 14:35:27 CEST

Original text of this message