HELP: Error while insert in master-detail form!!!
Hello
I have created a master-detail form and when I tried to insert a new record I got an error that the field on the detail table that references the primary key on the master table can not be null. I don't understand this error because I thought that when you create a master-detail form and you insert a new record the field that make the references in the detail table to the primary key on the master table will be automatically filled, am I wrong??. Can anybody tell me what is going on??. The primary key of my master table is filled with a trigger before insert, is that the problem??.
Please Help me is really urgent
Ana Maria
I am still new to this, but maybe this will help.
1. Double check that your foreign key link definition in the detail table is referencing the correct column in the master table. If this is not present or referencing the column, this may be causing the problem. Self evident, but sometimes it is the simple things that get us.
2. I have not used a trigger yet, but could there be validation being done in the form before the trigger is firing. Therefore, there would not be a value in the detail part of the form.
Hope this was of some help.
Similar Messages
-
Error while creating the master-detail forms
on creation of a new master-detail form or on edit of a existing master-detail form, i get the following error -
******** START ERROR **********
Thu, 15 Mar 2001 23:02:16 GMT
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "CC_INTRANET.WWV_BIND", line 56
ORA-06512: at "CC_INTRANET.WWV_UI_LOVF", line 3123
ORA-06512: at "CC_INTRANET.WWV_UIFORM_BUILD", line 2850
ORA-06512: at "CC_INTRANET.WWV_UIFORM_BUILD", line 5567
ORA-06512: at line 8
DAD name: cc_intranet
PROCEDURE : CC_INTRANET.wwv_uiform_build.show_header
URL : http://webdb.us.colorcon.com:7777/pls/cc_intranet/CC_INTRANET.wwv_uiform_build.show_header?p_wizard_mode=MASTER&
********** END ERROR ********
any ideas anyone ... ?
thanx in advance ...
nullmore information on above -
i upgraded webdb 2.2 to portal 3.0.6 and the new master-detail form is been created in the upgraded site.
pls reply on this.
thanx a bunch
null -
Error while saving in Master Detail Form
Hi,
I created a MD form in Portal. The form shows up fine. When I try to enter data at the master level and hit Save, I get the following message:
An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-16016)
Please let me know how to fix this?
ThanksI am still new to this, but maybe this will help.
1. Double check that your foreign key link definition in the detail table is referencing the correct column in the master table. If this is not present or referencing the column, this may be causing the problem. Self evident, but sometimes it is the simple things that get us.
2. I have not used a trigger yet, but could there be validation being done in the form before the trigger is firing. Therefore, there would not be a value in the detail part of the form.
Hope this was of some help. -
Error ORA-01790: for INSERT in master detail form
Gidday;
I get the error message 'ORA-01790: expression must have same datatype as corresponding expression' when I attempt an insert operation in the detail region of a master/detail form.
I have checked previous entries of this error I could find - as far as I can tell the parent key defaults are correct.
It seems one of the factors could be that the tables are not within the 'home' schema for the application. I have created a similar default master detail form on the tables, with the home schema matching that for the tables. Within my major application I have ensured the correct schema is referenced in all fields (all those I could find - in the Report Attributes / Column Attributes area).
I just cannot find which expressions are mis-matching their datatypes.
thanks; DSHi,
According to [http://ora-01790.ora-code.com] the error is raised because "A SELECT list item corresponds to a SELECT list item with a different datatype in another query of the same set expression." Do you have any Select Lists on your page? If you do, is the "return value" of the same datatype as for the underlying field?
One thing to try in these circumstances is to click the Debug link on the Developer's toolbar at the bottom of the page and then try to insert your record. You will get a whole stream of messages appear on the left of the page and the error should become obvious.
You could also check that all the defaults you have set do not contain spaces or linefeeds at the end - I have seen this cause issues before.
Andy -
Apex - Error in Checksum in Master-Detail Form Page
The following error message is thrown in a Page with a Master-Detail Form in Apex ,
ORA-20505: Error in DML: p_rowid=362, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-20503: Current version of data in database has changed since user initiated update process. current checksum = "71064C738DA3DADD5500149404378CFF" application checksum = "0"
Error Unable to process row of table "table-name".
Somebody can tell me what is happening ? Thanks.Please check this thread ORA-20505: Error in DML : ORA-20503: . There is a detailed discussion on the same error.
-
Error "field required" in master-detail form with FORMS 10G!!
I have a Master-Detail Form.
When the cursor stay in detail block and i chage the master record with the mouse, clicking in scroll bar, i get error "field required".
In Forms 6i, works fine!!Master block has more than one record displayed. When I click on any item in detail (except first one) and then click on different master record (return navigation to master block, but not current record) I have FRM-40202: Field must be entered on first item in detail block.
I found that reason is this part of clear_all_master_details procedure (automatically created by Oracle Forms):
IF :System.Cursor_Item <> startitm THEN
Go_Item(startitm);
Check_Package_Failure;
END IF;
Does any have same experience?
Is it Oracle bug or I am missing something? -
Inserting on Master Detail form
Hello,
I have created two tables. One I'm using as my master form and the other for my detail form.
Table 1
CREATE TABLE AGENCY (
AGY_ID NUMBER (9) NOT NULL,
AGY VARCHAR2 (1) NOT NULL,
AGY_DESC VARCHAR2 (10) NOT NULL,
AGY_DESC_LONG VARCHAR2 (100),
CONSTRAINT PK_AGENCY
PRIMARY KEY ( AGY_ID ) )
There is post insert trigger on AGY_ID using a sequence:
CREATE OR REPLACE TRIGGER PORTAL30.AGY_ID_PI
BEFORE INSERT
ON AGENCY
FOR EACH ROW
Begin
If inserting and ( :new.AGY_ID is null ) Then
select AGY_ID.nextval into :new.AGY_ID from dual;
End If;
End;
Table 2
CREATE TABLE OFFICECODE (
OFF_ID NUMBER (9) NOT NULL,
OFF_DESC VARCHAR2 (4) NOT NULL,
AGY_ID NUMBER (9) NOT NULL,
OFF_DESC_LONG VARCHAR2 (100),
CONSTRAINT PK_OFFICECODE
PRIMARY KEY ( OFF_ID ) )
There is a Foreign Key on OFFICECOD.AGY_ID TO AGENCY.AGY_ID:
ALTER TABLE OFFICECODE ADD CONSTRAINT OFF_AGY_ID_FK
FOREIGN KEY (AGY_ID)
REFERENCES PORTAL30.AGENCY (AGY_ID) ;
There is post insert trigger on AGY_ID using a sequence:
CREATE OR REPLACE TRIGGER PORTAL30.OFF_ID_PI
BEFORE INSERT
ON OFFICECODE
FOR EACH ROW
Begin
If inserting and ( :new.OFF_ID is null ) Then
select OFF_ID.nextval into :new.OFF_ID from dual;
End If;
End;
I create a MD form in Portal 3.0.9.8.0 just fine. However I cannot insert the master and the detail at the same time because I get the following error:
Error: An unexpected error occurred: ORA-01400: cannot insert NULL into ("PORTAL30"."OFFICECODE"."AGY_ID") (WWV-16016)
If I create the Master record 1st, then add the detail records it works fine. But how do I insert the Master and the detail records at the same time?
Thanks,
MartinMartin,
I had the same problem and with the help of some other folks in the forum I came up with this. It goes on the save button, plsql event handler. You'll see the 'doSave' call at the end of the procedure. It checks the value of the Master Action List and if it is 'INSERT' then sequence.nextval will be selected into v_master_id and then inserted into the table. Let me know if you have any questions. It probably needs a little clean up and some functionality for delete but so far I haven't had any problems with it.
DECLARE
v_master_id number(10);
v_masteraction varchar2(10);
v_detailaction varchar2(10);
BEGIN
v_masteraction := p_session.get_value_as_varchar2(p_block_name=> 'MASTER_BLOCK', p_attribute_name=>'_MASTER_ACTION');
IF (v_masteraction = 'INSERT') THEN
select rfi_admin.rasset_qc_master_seq.nextval into v_master_id from dual;
p_session.set_value
(p_block_name => 'MASTER_BLOCK'
,p_attribute_name => 'A_ID'
,p_index => 1
,p_value => v_master_id
FOR i in 1..g_max_det_rec LOOP
p_session.set_value
(p_block_name => 'DETAIL_BLOCK'
,p_attribute_name => 'A_MASTER_ID'
,p_index => i
,p_value => v_master_id
END LOOP;
END IF;
IF (v_masteraction = 'UPDATE') THEN
v_master_id := p_session.get_value_as_varchar2(p_block_name=> 'MASTER_BLOCK', p_attribute_name=>'A_ID');
END IF;
FOR i in 1..g_max_det_rec LOOP
v_detailaction := p_session.get_value_as_varchar2(p_block_name=> 'DETAIL_BLOCK', p_attribute_name=>'_DETAIL_ACTION', p_index => i);
IF (v_detailaction = 'INSERT') THEN
p_session.set_value(p_block_name=> 'DETAIL_BLOCK', p_attribute_name=> 'A_ASSET_QC_MASTER_ID', p_index => i, p_value=> v_master_id);
END IF;
END LOOP;
doSave;
END; -
Hi All,
i m getting the following error when i m creating a master entry ...
ORA-06550: line 5, column 23: PL/SQL: ORA-02289: sequence does not exist ORA-06550: line 5, column 16: PL/SQL: SQL Statement ignored ORA-06550: line 8, column 16: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 8, column 9: PL/SQL: Statement ignored
but while creating the master detail form i had specified the corresponding sequences and they even exist in the DB.
Please ! do help me .
Thanks & Regards,
Nandini Thakur.Hi ,
Though u choose the schema name ...the sequence is not appended with the schema name .
Example you are craeting the application in schema 1 and ur database objects are in schema 2.
so while creating the Master detail form you will get the option of choosing the schema, but then also the sequence name is not appended (as this may be the problem or bug in apex) .
so one needs to manually go and append the schema name.
In master detail form one needs to append it
1) Form of the Master ...the process called as get primary key there the sequence name should be appended
ex:- myschema.seq
2) another is the detail tabular form . here you need to good to the id hidden field and edit it , then in the source column append it with the myschema.seq.
Regards,
Nandini Thakur -
FRM-40654 error in master-detail form while deleting record in detail block
Hi,
I am facing an issue in a custom form which is a Master-detail form while deleting a record in detail block. It is giving an error "FRM-40654 Record has been Updated by another user. Re-query to see change". I have checked the record is matching with that in database.
Can anyone help on this.
Thanks In Advance,
MidhunHi jan,
master block is based on Table "A" and detail block is based on a View "X".
View "X" definitions includes the tables "A","B","C" etc..
Now I have tried removing table"A" from view "X", even then the same error is ocuuring but the lock is happening on table "B" instead of "A"
Thanks,
Midhun -
Insert error in master-detail form
Probably a stupid question. When I populate the master block of
a master detail form from an LOV, I am asked to save the form.
Since the information is loaded from the LOV, there are no
changes to save. If I answer yes, it gives an Insert error due
to the primary key violation in the master block table. If I
answer no, it opens the detail block and gives the correct
information. The problem is that when I enter information into
the detail block and try to save it, I get the same error
message regarding the primary key violation in the master block.
The form works fine if I do not populate the master block from
the LOV (or from select statements in triggers). Any suggestions
will be appreciated.
LSHi,
Check for the form or block status.Looks like the status has
changed.Thats why u r getting the message.If any of the base
table item has changed then u will get such a message.Try
working on this an check it out.
Thanks
Vinod -
Inconsistent inserts into detail table of master-detail form
Hello,
[I am not sure if this is a bug or user error, so I've also put this in the bug tracking system. Apologize for the 'duplication']
I have a master-detail form: Orders is the master, and Order_Details is the detail. I have noticed some inconsistent behavior when inserting the detail information.
On occasion, the row will be inserted, and a null value will get inserted into the database for the first column of the detail table; all the other data values will be inserted fine. There doesn't seem to be any pattern to when it happens. I wrote down the following test steps:
1. Enter new order information and click 'Create'
2. Click 'Add Row' button so can add order detail info
3. Enter detail row information
4. Click 'Add Row' (I do this so I can see the success message that the detail data was actually inserted)
5. Click 'Apply Changes' at the master level.
I ran a query on the order details table and saw that the data inserted correctly. Then I ran the following test:
1. Enter new order information and click 'Create'
2. Click Add Row button so can add order detail info
3. Enter detail row information
4. Click 'Add Row' (success message appears that detail was inserted)
5. Enter second detail row information
6. Click 'Add Row' (success message appears that detail was inserted, however, now in the first column of that second detail row - the product name field/column - the data does not appear. I only see my null text value. The data in the first detail row is all correct)
7. Enter third row detail information
8. Click 'Add Row' (success message appears that detail was inserted, and this row's information appears correctly, as does the first row's, but the second row is still showing a null value for the product name column)
9. Click 'Apply Changes' to get out of the form
A query of the order details table shows that a null value (-) has indeed been inserted into the table for the product name column of the second detail row.
This behavior also happens when I don't have a null value for the LOV (i.e., it defaults to the first row of the lookup table).
Has anyone seen this before? Am I entering the data incorrectly?
Thanks.
-melissa
Message was edited by:
mblakenehaving the some problem. Any help with this ??
milowski were you able to solve it ? can you share the information.
Thanks -
How can I insert in the table detail of a master/detail form??
Hello, I have created a master/detail form from the assistant, and with the code generated by APEX I do not manage to insert a row in the table detail, I press the button 'Add Row' and refill information, when I press the button ' to apply changes ' me the following mistake appears:
'Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "C85B64D53C8D63E9D3EE83B82728DFA3", item checksum = "244B1FED90DF5CC5B0DDB6728F4D02DD"., update "CRM_ADMIN"."ASIGNACIONES_AM_CONTACTOS" set "SECUENCIA" = :b1, "CODIGO" = :b2, "NOMBRE_CLIENTE" = :b3, "NOMBRE" = :b4, "COMENTARIOS" = :b5, "CODIGO_COMERCIAL" = :b6'
How I can solve and be able to insert in the table it detail?
ThanksHi Law,
Text in a shape or a text box will not feature in the table of contents.
To get a colour behind your titles, type them into your document (not a shape). Format as Heading or some other paragraph style the TOC will recognise.
Select the title text and Format Panel > Text > Font > Gearwheel > Advanced Options.
Choose Character Fill Color and choose a colour from the palette (left) or colour circle (right).
Example Titles (all on the same page for a smaller screen shot).
Chapter 3 (in a coloured Text Box or Shape) does not appear in the TOC:
Hint for cheats :
To give the titles a wider Character Fill Colour, add some Tab characters before and after.
Regards,
Ian. -
Master Details Forms- Report getting error
Dear All,
I have used master details form . In details form , i am having 50 fields . i am able to add row. after that it is showing error ike below.
Error:
=============================================================================
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "D63F13336F2D8570B20FC4825A7B836A", item checksum = "809B7E0170040C75637E80BE2D464C77"., update "SIFY"."REG_MANAGER_DETAILS" set "RMD_ID" = :b1, "RMD_RM_ID" = :b2, "RMD_ACMAN_NAME" = :b3, "RMD_CONN_OT_CUR" = :b4, "RMD_CONN_RS_CUR" = :b5, "RMD_CONN_HW_CUR" = :b6, "RMD_HOST_OT_CUR" = :b7, "RMD_HOST_RS_CUR" = :b8, "RMD_HOST_HS_CUR" = :b9, "RMD_EAS_OT_
=============================================
What will be solution to resolve this type of error ?
Please help me to resolve this. Thanks in advance.
Regards
Dhanush.RDhanush,
This is an optimistic locking checksum error. It's trying to tell you that it can't save because someone/thing has updated the data already and it doesn't want to overwrite it. Is that always occurring?
Regards,
Dan
Blog: http://DanielMcGhan.us/
Work: http://SkillBuilders.com/ -
Master detail form Error in mru internal routine: ORA-20001
Hi,
i created a master-detail form with apex standrad wizard.
Master e datail are on the same page.
All works fine.
My detail form contain some fields of my detail table.
Now i added a link on detail form for call a form with all fields of my detail table.
The link work fine.
When i try to add row or update my detail form i receive the error
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "D472A2BF636CA11122F196B8A32B3DC8", item checksum
Any help?
Thanks in advance
LukxLukx,
I've just reproduced your what I believe you wanted and didn't receive any errors. Here are the steps I took.
1) Used the wizards to create a Master Detail form (with Detail edit on the same page as the master and only showing 2 of the detail columns)
2) Used the wizard to create a FORM ON A TABLE for my detail table allowing the user to edit all detail columns
3) Created a "column link" column on the detail form of the Master Detail form which links to the FORM ON A TABLE, passing across the ID of the detail record.
When I do this, everything seems to work perfectly as expected.
Is there something I'm missing in the steps you performed to create your scenario?
Thanks
Doug
http://www.sumneva.com -
Session storage errors in master-detail form
hi,
as the sequences do not work in master detail forms, i'm using session variables but the form does not compile and gives error.
following is my code in the SAVE button of the master-detail form -
declare
new_prod_id number(10);
begin
select BPSIDEV.PRODUCT_ID_SEQ.NEXTVAL
into new_prod_id
from dual;
p_session.set_value
p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_PRODUCT_ID',
p_value => new_prod_id
doSave; -- This is generated code
end;
the action item values is as foloows -
Master - INSERT
Detail - INSERT
am i missing here something ? or is anything wrong here ?? pls advise ...
after the above changes the form would not compile at all.
also how would i populate the the detail records with the foreign key ??
thanx...
nullThis problem is fixed in 3.0.8 release of Portal which will be available with the next release of iAS.
Actuallty the fix is simple look at the generated package of EXAMPLE_MD_FORM from EXAMPLE_APP, onSave event handler looks like this:
procedure onSave
p_block_name in varchar2,
p_object_name in varchar2,
p_instance in integer,
p_event_type in varchar2,
p_user_args in varchar2,
p_session in out WWV_30898.wwa_api_module_session
is
"_master_block" varchar2(30) := 'MASTER_BLOCK';
Some more code.......
And then closer to the end in detail processing section there is something like:
"_d_data_rec".COMM:=p_session.get_value_as_NUMBER(
p_block_name => "_detail_block",
p_attribute_name => 'A_COMM',
p_index => "_cnt"
"_d_data_rec".DEPTNO:=p_session.get_value_as_NUMBER(
p_block_name => "_detail_block",
p_attribute_name => 'A_DEPTNO',
p_index => "_cnt"
===========================================
You'll need to insert following code, just one if statement, that's it. Please note every time you regenerate the package this code will be lost, so you'll need to add this agains and again. Not a perfect solution, that's why I like JS workaround better.
============================================
if "_d_data_rec".DEPTNO is NULL and "_m_data_rec".DEPTNO is NOT NULL
then
"_d_data_rec".DEPTNO := "_m_data_rec".DEPTNO;
end if;
============================================
============================================
if "_detail_action" = 'DELETE' and "_DETAIL_ROWID" is not null then
DELETE FROM WWV_30898_DEMO.EMP WHERE ROWID = "_DETAIL_ROWID";
"_detail_deleted" := "_detail_deleted" + 1;
elsif "_detail_action" = 'UPDATE' then
UPDATE WWV_30898_DEMO.EMP SET EMPNO="_d_data_rec".EMPNO,ENAME="_d_data_rec".ENAME,JOB="_d_data_rec".JOB,MGR="_d_data_rec".MGR,HIREDATE="_d_data_rec".HIREDATE,SAL="_d_data_rec".SAL,COMM="_d_data_rec".COMM,DEPTNO ="_d_data_rec".DEPTNO WHERE ROWID = "_DETAIL_ROWID" ;
"_detail_updated" := "_detail_updated" + 1;
elsif "_detail_action" = 'INSERT' then
INSERT INTO WWV_30898_DEMO.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES ("_d_data_rec".EMPNO,"_d_data_rec".ENAME,"_d_data_rec".JOB,"_d_data_rec".MGR,"_d_data_rec".HIREDATE,"_d_data_rec".SAL,"_d_data_rec".COMM,"_d_data_rec".DEPTNO) RETURNING ROWID INTO "_DETAIL_ROWID";
"_detail_inserted" := "_detail_inserted" + 1;
end if;
............................
Maybe you are looking for
-
Creating a separate apple id/password for a single devise that is already registered
I am having a terrible time managing the family's devices on iTunes. I was trying to use one apple id and password for all, but when i last synced all of my devices, my contacts and calendar events were all replaced with my 15 year old son's! I spe
-
Please help me !!! How can change Rescue email address for reset security questions ... Thanks
-
Qosmio F20 - Built-In HDD error
My F29 took a hefty knock today around the HDD area on the forward right,while my kids were playing around. In hefty i mean that when it got knocked it unclipped the speaker panal near the sreen. For a while it continued to work but about 10 mins lat
-
when i am trying to restore my iPhone 5s from the recovery mode,it always stuck when restoring iPhone firmware. The message said " an unknown error occurred (1)". Tried all reboot, restart the iTunes etc. no luck
-
Finding the texts/descriptions on infotype 0001
Are there any standard Function modules to read the texts ( or description) on certain fields on infotype 0001... the fields are .. positions, cost center , fund , grant , org unit etc... If there are no FMs.. then what tables are the best ones to re