|
|
Re: Master-Detail [message #125060 is a reply to message #125040] |
Thu, 23 June 2005 01:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
vinu.m@naizak.com
Messages: 6 Registered: June 2005
|
Junior Member |
|
|
sorry david, actually i typed the matter also. i dont know where is the matter. I will explain again...
I have a very serious issue ... pls help me ...
The problem is i have 4 Datablocks.
A PL_T_MAINTENANCE_HD
B PL_T_MAINTENANCE_DET
C PL_T_MAINTENANCE_TECNI_DET
D PL_T_MAINTENANCE_MATERIAL_DET
B is having one to many relation with A
C and D is having one to many relation with B . Against a work order, there are many tasks. Against one Task there are many technicians and many materials. Once i filled a task in B and went to C to enter the technicians and to D to enter materials. After the entry of technicians and materials, i will click on the block B to enter next task. At this time form is asking me whether i need to save the record, if i clicked Yes, it will save and clear the form. I don't want this, i need to be saved at the end ..... i tried POST in the when new block instance on the block B but it is saving all the form and causing the primary key failure error since the Work Order Number will be generated as a part of the commit process.
I tried the POST ... for that the work_order_no is one among the primary key and this number will be generated only at time of saving. Without this work_order_no, "post" is generating error.
I would like to have some work arround for this issue
thanks in advance
Vinu
|
|
|
|
Re: Master-Detail [message #125076 is a reply to message #125066] |
Thu, 23 June 2005 03:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
vinu.m@naizak.com
Messages: 6 Registered: June 2005
|
Junior Member |
|
|
hi martin
A PL_T_MAINTENANCE_HD = Work Order
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Primary Keys are : V_WORK_ORDER_NO and N_CO_CODE
B PL_T_MAINTENANCE_DET = Task
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Primary Keys are : V_WORK_ORDER_NO, V_TASK_CODE and N_CO_CODE
C PL_T_MAINTENANCE_TECNI_DET = Technician
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Primary Keys are : V_WORK_ORDER_NO, V_TASK_CODE, V_EMPI_IDNO and N_CO_CODE
D PL_T_MAINTENANCE_MATERIAL_DET = Material
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Primary Keys are : V_WORK_ORDER_NO, V_TASK_CODE, V_ITEM_CODE and N_CO_CODE
These are the Primary Keys for the four tables. Am not "reusing" the technicians and materials for another tasks. It will be entered again if they required.
Some Important Columns from each table
A PL_T_MAINTENANCE_HD = Work Order
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
V_WORK_ORDER_NO VARCHAR2(12 BYTE),
D_WORK_ORDER_DATE DATE,
V_DOC_AGAINST CHAR(1 BYTE),
V_REQ_NO VARCHAR2(12 BYTE),
V_ASSET_NO VARCHAR2(20 BYTE),
V_ASSET_DESC VARCHAR2(200 BYTE)
....
....
B PL_T_MAINTENANCE_DET = Task
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
V_WORK_ORDER_NO VARCHAR2(12 BYTE),
V_TASK_CODE VARCHAR2(7 BYTE),
V_TASK_DETAIL VARCHAR2(3000 BYTE),
D_SCH_DATE DATE
...
...
C PL_T_MAINTENANCE_TECNI_DET = Technician
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
V_WORK_ORDER_NO VARCHAR2(12 BYTE) NOT NULL,
V_TASK_CODE VARCHAR2(7 BYTE) NOT NULL,
V_EMPI_IDNO VARCHAR2(10 BYTE) NOT NULL,
N_MANPOWER_COST NUMBER(7,2)
...
...
D PL_T_MAINTENANCE_MATERIAL_DET = Material
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
V_WORK_ORDER_NO VARCHAR2(12 BYTE) NOT NULL,
V_TASK_CODE VARCHAR2(7 BYTE) NOT NULL,
V_ITEM_CODE VARCHAR2(20 BYTE) NOT NULL,
N_QTY NUMBER(10,3),
...
...
I hope i cleared ur doubts
Cheers !!!
Vinu
|
|
|
|
Re: Master-Detail [message #125089 is a reply to message #125083] |
Thu, 23 June 2005 04:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
vinu.m@naizak.com
Messages: 6 Registered: June 2005
|
Junior Member |
|
|
David,
thanks for the info.. But am thinking that we are moving apart from my concern. My problem is once i entered the technicians and materials in block C and D against a task in block B and adding the next row in block B form is prompting me to save the records, which i dont want. I must be able to enter the C and D again for another task. The V_WORK_ORDER_NO is a system generated value and i would like to generate that number only at time of saving
vinu
|
|
|
Re: Master-Detail [message #125223 is a reply to message #125089] |
Thu, 23 June 2005 19:51 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
V_EMPI_IDNO is also automatically generated, isn't it?
Okay ... how about trying it my way ... it is doesn't work, tell me ... if it does work, then you can decompose it back to your intention.
A Master-Detail relationship needs to have data for the primary key fields (its in a book somewhere).
The worst solution, which I detest and your have said you don't want, is at each block to test the RECORD_STATUS and if it is CHANGED or NEW, do a COMMIT.
David
[Updated on: Thu, 23 June 2005 19:52] Report message to a moderator
|
|
|