Home » Developer & Programmer » Forms » Multiple one to many relationship
Multiple one to many relationship [message #453204] Tue, 27 April 2010 20:23 Go to next message
coolbharat4u
Messages: 30
Registered: April 2010
Member
Hi,

I have a table which has 2 one to many relationships like a tree structure in the same table, is there a way that I can show the same on the form and be able to do the insert and update on the same table?

Thanks
CB

[Updated on: Tue, 27 April 2010 20:32]

Report message to a moderator

Re: Multiple one to many relationship [message #453437 is a reply to message #453204] Thu, 29 April 2010 00:19 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
This sounds like a standard master-detail form with two detail blocks.

Just use the wizards and tell us how you progress.

David
Re: Multiple one to many relationship [message #453539 is a reply to message #453437] Thu, 29 April 2010 08:49 Go to previous messageGo to next message
coolbharat4u
Messages: 30
Registered: April 2010
Member
David,

Its like the same table and multiple one to many relationships, I mean I created 3 data blocks the datablock A has multiple records in datablock B and datablock A along with B has Multiple records for datablock C, all this in same table, please find the attached screenshot, the problem here is when I try to update the records or insert records.


Thanks
  • Attachment: doc.jpg
    (Size: 1.79MB, Downloaded 911 times)
Re: Multiple one to many relationship [message #453541 is a reply to message #453204] Thu, 29 April 2010 09:04 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Try recreating with the blocks with the datablock wizard.

And saying you have a problem with inserting and updating is basically useless - we need to know what problem is, what error messages you are getting etc.
Re: Multiple one to many relationship [message #453566 is a reply to message #453541] Thu, 29 April 2010 12:24 Go to previous messageGo to next message
coolbharat4u
Messages: 30
Registered: April 2010
Member
I tried this using views for different blocks
also tried using from clause query for the second block setting the query data source name, these are the errors I was getting
FRM-40654 Records has been updated by another user Re-query to see change

FRM 40735 ON UPDATE TRIGGER RAISED UNHANDLED EXCEPTION
ORA-00001 Unique constraint voilated

there was a lock which was occuring here(on-lock).


Thanks
Re: Multiple one to many relationship [message #453592 is a reply to message #453204] Thu, 29 April 2010 17:45 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why don't you give us the table structure along with a description of what the relationship between the blocks should be.
Re: Multiple one to many relationship [message #453598 is a reply to message #453592] Thu, 29 April 2010 20:31 Go to previous messageGo to next message
coolbharat4u
Messages: 30
Registered: April 2010
Member
Please find the attached file, here

1)item id, description has multiple UOM, PURCHASABLE,MATERIAL,MAKEBUY


2) item id, description, UOM,PURCHASABLE,MATERIAL,MAKEBUY has multiple labor and pay_uom all are from same table


All are from the same table, we need to show this in form in the way I attached the previous doc.

Here I tried to create 3 views and tried to insert or update but there was an error, even when I tried the from clause query in Query data source name for the block2 which has item id, description, UOM,PURCHASABLE,MATERIAL,MAKEBUY (item id, description invisible in block two)I had an error, hope this is clear for you.
  • Attachment: DOC1.JPG
    (Size: 69.13KB, Downloaded 626 times)
Re: Multiple one to many relationship [message #453604 is a reply to message #453598] Thu, 29 April 2010 23:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
It sounds as though the subordinate table, which you are accessing through two blocks, is displaying the same records. Is this true?

If so, then consider only having ONE block and display the columns over the two canvases.

David
Re: Multiple one to many relationship [message #453663 is a reply to message #453204] Fri, 30 April 2010 04:07 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
What's the primary key of the table?
Re: Multiple one to many relationship [message #453701 is a reply to message #453204] Fri, 30 April 2010 06:07 Go to previous messageGo to next message
gregor
Messages: 86
Registered: March 2010
Location: Germany
Member
Hi,

please consider to review the Layout in your Form.
To work only on ONE row of the same table,
it could be an solution to build filter on the Records
you want to see or change.

1.Controllblock (no Basetable)
|________________| |_____________| <-- Search Criteria
Level 1 ( ID,DESCRIPTION)
2.Multirow-Basetableblock with Search Results
|________________| |_____________| |_.....
|________________| |_____________|
|________________| |_____________|
|________________| |_____________|
3.Filterrow (no Basetable) for Labor or want ever you want
|V_______________| |V____________|

Built the query dynamic : in Pre-Query (after Search-Button)
( if :filterlaborid is not null then filterstring :=
set_block_property('BASTABLEX',ONE_TIME_WHERE,'your filter-
string') . .... if if
At start up show all row or none.
Re: Multiple one to many relationship [message #453702 is a reply to message #453204] Fri, 30 April 2010 06:11 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm pretty sure the only sensible solutions here are to have only one block or split the table into three seperate tables.
Previous Topic: How to create Data Block Using Stored Procedure in Forms10G
Next Topic: Role based menu security
Goto Forum:
  


Current Time: Fri Sep 20 08:41:03 CDT 2024