Re: Question on master-detail form!!!!

From: Paul Dorsey <pdorsey_at_dulcian.com>
Date: Mon, 21 Jun 1999 02:11:48 GMT
Message-ID: <Ebhb3.25561$eF3.9368_at_news.rdc1.nj.home.com>


You are having a problem because you are trying to do something that makes no sense unless you only have one column in your master.

I think the cleanest solution for your problem is to put an instead of trigger on your master table to take over the default insert behavior.

Another alternative is to make your master block query only and to do inserts or not in client side code.

If you are just trying to insert, why even bother with the master block? Just use a single detail block and make sure the master exists on a before insert trigger for the block. If it doesn't exist, insert it.

--
Paul Dorsey
Dulcian, Inc.
www.dulcian.com
212 595 7223
Ashok K Solipuram wrote in message ...

>Hi,
> I created Master_detail form.The details are as follows:
>
>Master has a primary key column on which it is joined to detail block.
>On the form,I have one field(Primary Key) in master block and several
>fields(columns) in the detail block and both are on the same canvas.
>When I run form & enter a new item in master field & corresponding details
>records for that master & save it,its saves fine,but when I clear form &
>enter same field(item) in master record & enter different detail record
>for the same master item,it does not save the detail record,it gives error
>"Oracle Unable to insert record" and when I click on history,it tells me
>that "ORA-00001:UNIQUE CONSTRAINT(Primary Key)VIOLATED" and cursor moves
>to Master Block.
> But if I query & try to insert detail record for that master,it
>saves.The problem comes only when I try to insert a detail record for
>already existing master record & also if it already had some detail
>records.
>
> Can anyone tell me,is there way to insert detail record for already
>existing master record other than querying and inserting detail record.
>
> can anyone tell me how to populate details automically if it exists for
>the master record when we enter the master item without manually
>executing the query in detail block.
>
>Thanks in Advance.
> Ashok.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Received on Mon Jun 21 1999 - 04:11:48 CEST

Original text of this message