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...
null

This 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;
............................

Similar Messages

  • 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.
    LS

    Hi,
    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

  • Error in Master Detail Form

    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,
    Midhun

    Hi 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

  • Error creating Master/Detail Form

    Hi,
    I tried to create a master detail form. I went through all the steps fine, only when i click the button to create the form, i received the following errors:
    ORA-20001: Unable to create master detail page. ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Unable to create Master Detail pages.
    Could someone please tell me what's wrong?
    Thanks,
    Patrick.

    We are getting this message in several areas in the development environmnet. It's happening in the developer login screen, when creating new tabs, and when tryig to create master detail reports. Here is our error from the Apache Log:
    [Mon Mar  2 11:41:31 2009] [error] [client 10.64.8.231] [ecid: 1236012090:148.94.143.136:24226:0:1621,0] mod_plsql: /pls/apex_qmnt/wwv_flow.accept HTTP-404 ORA-06502: PL/SQL: numeric or value error\nORA-06512: at line 31\n
    I think this is different from the issue above as that is due to too many items in a shuttle list. Ours seems to be related to our new APEX insstallation. Any help is appreciated here.

  • 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 ...
    null

    more 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

  • 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.R

    Dhanush,
    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
    Lukx

    Lukx,
    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

  • 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.

  • 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?

  • 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; DS

    Hi,
    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 Master Detail Form error

    I have created a master detail form. Detail table's primary key consists of 3 columns. When i am updating anything it gives the following 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 = "BC743AF059FDFE4F2814A5EF2A03AC84", item checksum = "7B54748980DD8AB6BF30D538843F520F"., update "APEX_DEV"."V_DATA_STRM_VLDT_CNFG" set "VLDT_SEQ_NUM" = :b1, "DATA_STRM_SID" = :b2, "VLDT_TY_SID" = :b3, "VERI_CTG" = :b4, "LAYT_DEPN_I" = :b5, "REC_FLD_SID" = :b6, "BG_EFF_D" = :b7, "END_EFF_D" = :b8, "CRE_USR_ID" = :b9, "CRE_TMST" = :b10, "UPD_USR_ID
    Can any body tell me what's wrong with the form ?
    Thanks in advance.
    Best Regards,
    Prakash

    Prakash,
    The built-in master-detail forms in APEX currently only support primary keys with one or two columns. Also, neither one of you primary columns can be part of a foreign key. We're considering extending this in APEX 4.0. Until then, you will have to write your own update routines as a page process on the master-detail page.
    Regards,
    Marc

  • Master detail form - Cascade Delete gives error

    I am using 3.0.9.8.2 and have made a master detail form which works fine except for cascade delete. Insert and update works well, but I have to delete the child rows first to be able to delete the parent.
    "Cascade Delete Detail Rows on Master Delete" is checked.
    Error situation 1 (where the master just has one child row (number of detail rows to be displayed = 2)):
    When trying master action=delete I get:
    Error: No conversion performed for type INTEGER, value . (WWC-49102)
    This happens whatever is chosen from the detail action drop down list during the attempted delete.
    Error situation 2 (where the master has two child rows (number of detail rows to be displayed = 2)):
    When trying master action=delete I get:
    Error: An unexpected error occurred: ORA-02292: integrity constraint (MILLS_PORTAL.TEX_ACCOUNTS_FK) violated - child record found (WWV-16016)
    This also happens whatever is chosen from the detail action drop down list.

    Sorry to say, but this is a bug which will get fixed in the forth coming releases.
    Till then, there are 2 ways to avoid this problem:-
    1> The change the foreign key in the detail table to have an ON DELETE CASCADE clause.
    2> (Though not desirable, but still as a workaround)- Drop the foreign key constraint from the detail table.

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

Maybe you are looking for