Home » Developer & Programmer » Forms » Form Updation(linking of three tables) (forms 6i)
Form Updation(linking of three tables) [message #285381] Tue, 04 December 2007 06:09 Go to next message
satishveluru
Messages: 8
Registered: September 2007
Junior Member
hai,
i have threee tables
1)master
2)parent
3)child


strucure of these tablers like

master( ackno number,
assessmntyear varchar2,
financial year varchar2,
----
-----);

parent (ackno number,
assessmntyear varchar2,
financial year varchar2,
headcode varchar2,
amount varchar2,
-------)

child (ackno number,
assessmntyear varchar2,
financial year varchar2,
headcode varchar2,
subhead varchar2,
subamount number,
---);

coming to form
------------------
after giving master details it will go to parent details
by pressing parent it will go to child details
for very first time it is saving
and next time upadastion it is not allowing
unique constraint violated;

master
ackoo1 2001-2002 2000-2001

parent
business 1000

child
business loss 100

this is the form strucure

suppose i want to update 100 to 80 next time retrival it is showing unique constraint violated;






Re: Form Updation(linking of three tables) [message #285385 is a reply to message #285381] Tue, 04 December 2007 06:25 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
We'll need a little bit more information: what constraint on what table is violated? And next time, if you use the tags [CODE] and [/CODE] around your code samples, your code is easier to read.

Is the following structure correct? Foreign key relations are displayed with 'REF'.
master( ackno    number
      , asm_year varchar2
      , fin_year varchar2
      );

parent( ackno    number    REF master.ackno    
      , asm_year varchar2  REF master.asm_year 
      , fin_year varchar2  REF master.fin_year 
      , headcode varchar2
      , amount   varchar2
      );

child ( ackno    number   REF parent.ackno   
      , asm_year varchar2 REF parent.asm_year
      , fin_year varchar2 REF parent.fin_year
      , headcode varchar2 REF parent.headcode
      , subhead  varchar2
      , subamount number
      );
It appears that your form is trying to insert a new record instead of updating the existing record.

MHE
Re: Form Updation(linking of three tables) [message #285413 is a reply to message #285381] Tue, 04 December 2007 07:49 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you write your own triggers? If so, try to make this form once again, but this time do it ONLY by using Data Block Wizard. Don't pay too much attention to its beauty (formatting items etc.), just follow wizard's instructions and correctly join all three tables (blocks) via data block relations.

By default, the form will work correctly and take care about inserting, updating or deleting records from all three blocks.

Once you make it work, make it fancy (i.e. add your code; write triggers, procedures or whatever you need).
Re: Form Updation(linking of three tables) [message #285594 is a reply to message #285413] Wed, 05 December 2007 02:05 Go to previous message
satishveluru
Messages: 8
Registered: September 2007
Junior Member
thank you for your reply
i think you got my error while updation the records;

with updation ;
from master data it is going to retrieve parent data from(different table)

this is linking with previous data .
here suppose for the master field(assessmntyear 2000-2001;)
we are retrieving parent data from one form and putting into current form (using cursor );
and saving the inthe current form;
ok thanu i will try with datablocks;

keep in touch
bye;


Previous Topic: FRM-41211 error when using RP2RRO_RUN_PRODUCT
Next Topic: problem with displaying Arabic(Farsi ) alphabets
Goto Forum:
  


Current Time: Mon Feb 03 01:03:05 CST 2025