Error: FRM-40657, Block based on Procedure

Hi,
I have a detail block, its Qry Data Source is Procedure, and the DML is to a table,
The data is loading from two table say A and B, but the DML is to table B only.
The pblm is when editing the data from A(if the data loaded from the Table A satisfy certain condition then I have to store that data into Table B along with other data selected from table B, i am getting the error FRM - 40657.
Thanks in advance

Hi,
You are running into the error because you are trying to change or delete a record when you have already 'locked' it by viewing it in your form.
If you do need to do it this way, you will have to clear data from table B and then do the updates/inserts and then requery the data.
Hope I've understood what you mean!
L :-)

Similar Messages

  • Display a message in status bar when error in a block based procedure

    Hi
    I have a block based on procedures.
    If I have an exception when I try to insert a record for example, how can I display a user friendly message in the status bar ?
    here is my insert procedure :
    PROCEDURE emp_insert2(t IN emptab) IS
      BEGIN
        FOR i IN t.first..t.last LOOP
        INSERT INTO emp (empno, ename, job, hiredate, sal)
        VALUES(t(i).empno, t(i).ename, t(i).job, t(i).hiredate, t(i).sal);
        END LOOP ;
      EXCEPTION
        When DUP_VAL_ON_INDEX then
            Raise_Application_Error( -20002, '^This identifier already exists^' ) ;
      END emp_insert2;When I use the ON-FORM trigger and ERROR_CODE and ERROR_TEXT variables, I get an FRM-XXXX message saying :
    40735--INSERT-PROCEDURE trigger raised unhandled exception ORA-00001.
    I want a message like :
    ORA-20002 This identifier already exists

    Hello,
    ORA-20500: ^This identifier already exists^ ORA-06512: à "SCOTT2.EMP_PKG", ligne 48
    I cannot figure out what is the problem described by the second part of the message.
    why numeric or value error in this case ? ( ligne 48 corresponds to the raise_applicaion_error instruction )There is no problem with the second part it is just for showing the line number it not the numeric or value error the code for numeric or value error is ORA-06502. See the below link for more information
    http://www.techonthenet.com/oracle/errors/ora06512.php
    So, now you can display your customized message in status bar using the error code which you defined in RAISE_APPLICATION_ERROR like below...
    DECLARE
         errcode VARCHAR2(50) := DBMS_ERROR_CODE;
         errtxt VARCHAR2(1000) := DBMS_ERROR_TEXT;
    BEGIN
         IF vErrCode='-20500' THEN
            MESSAGE('Here display your customized message.');
         ELSE
            -- Handle the rest errors...
         END IF;
    END; -Ammad

  • What are possible reason for error : FRM-40657

    Hi,
    There is 3 blocks in my form, Master Block, It's Deails and It's Details also.
    The Query Data Source for all the block is Procedure, because for each block the data is coming from one more table other than the DML table.
    But I am getting the error FRM:40657 while editing the data, the flow of the system is, if the data in the block satisfy certain condition, then that row should be saved to DML table. For eg, there is one column Status if the value of the status column is Valid then that row should be saved to DML table, all the data coming from the non DML table is InValid, and the data from DML table is Valid,
    but after loading, when I change InValid to Valid, because some rows the user want to change to Valid then obviously it should be saved to DML table , but I am getting this error, What could be the pblm...
    Thanks in advance

    Hi Mark,
    Thank U. No other user has updated the data. As I said, the problem occuring datas are coming from Table A, and let the user to modify the data, after the modification, copy of some records (based on the data after modification ) want to be saved to DML table, say Table B. But this error is getting while try to save the modifications. But no problem to save the DML table (Table B) data.
    Hope U understood the requirements. Thanks in advance.
    Rizly

  • Error FRM-40657:Record Change or deleted by another user

    Hi dears
    Please HELP ME
    I have a form with multiple blocks and relationship between them
    I can insert in all of the blocks
    but I can not update the exiting rows in ANY block in application.
    I can update the rows from outside of the application
    it returns me this error:
    FRM-40657:Record Change or deleted by another user
    the properties about insert allowed,update allowed and so on are all YES in all blocks
    Would you please advise me about that?
    Need your help
    thanks
    Shahram

    This error occurs because the record as held in the Form is not the same as that held on the database. When Forms locks a record it checks the value of every database item on the Form with that currently stored in the database, and if the two are not the same it issues this error.
    This can happen for a number of reasons e.g.
    1. You may want to look at date fields and ensure the time component is being taken into account i.e. the LAST_MODIFIED column is stored as '01-JAN-2001 15:34:56' on the database but is stored as '01-JAN-2001 00:00:00' (a truncated date) on the Form.
    2. Check to see if there are any database triggers which alter the values of columns.
    You may need to go through every database item on the Form and compare it with the value on the database. Having found a discrepancy in values you need to determine why this occurs.

  • Need to create a block based on procedure

    We can create a block based on procedure...but whats the need to do so...please can anybody explain.

    There are several recent posts on the topic with a lot of good help & documentation.
    The Metalink note: 66887.1
    Re: Form on a procedure
    If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
    This is also very good reference:
    Block based on procedure
    Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
    Name = procedure name
    Arguments = procedure parameters (IN parameter(s) Value is :block.item)
    Source Columns = the record type columns for your table-of-records
    Datatypes & sizes must match all around.
    Start very simple & get it to work first, then expand.
    You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
    Have fun. It works awsome once you get the hang of it.

  • CHILD form error FRM-30100: Block must have at least one primary key item.

    Hi friends,
    I have increased the DML array of the child block from 1 to 10, but it throws me error:
    FRM-30100: Block must have at least one primary key item.
    Block: CEC_ADJUSTMENT_RECON
    Form: CEC_ADJ
    FRM-30085: Unable to adjust form for output.
    How does a form know that the table does not have primary key? Is it referring to it?
    Thanks a lot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I dont understand why do you increase the DML array size..
    Because it says in the HELP
    Specifies the maximum array size for inserting, updating, and deleting records in the database at one time.
    A larger size reduces transaction processing time by reducing network traffic to the database, but requires more memory.  The optimal size is the number of records a user modifies in one transaction.
    The FRM-30100 comes not because of the above property..
    If your query data source type is other than TABLE, it is a must to set at least one database field's PRIMARY KEY ITEM PROPERTY in the block to be a YES.

  • Record Who information for a block based on procedure

    Hi All,
    I have a block whose query data source type property is set to procedure and query data source name is a procedure. When I hit Ctrl F11 on this block it shows me all the records. When I see the record who information , I see all the record who information except the Table Name. I understand that the table name is not coming as the query data source name is a procedure for this block. Is there a way to dynamically set this query data source name to a table or a view while still retaining the procedure based functionality. I tried set_block_property for this property but form won't allow.
    Thanks

    There are several recent posts on the topic with a lot of good help & documentation.
    The Metalink note: 66887.1
    Re: Form on a procedure
    If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
    This is also very good reference:
    Block based on procedure
    Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
    Name = procedure name
    Arguments = procedure parameters (IN parameter(s) Value is :block.item)
    Source Columns = the record type columns for your table-of-records
    Datatypes & sizes must match all around.
    Start very simple & get it to work first, then expand.
    You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
    Have fun. It works awsome once you get the hang of it.

  • Block based on procedure - trapping errors

    Hi,
    I have created a form with a block based on a procedure but when there is an error in the procedure it is not being trapped. I have raise_application_error in the execption but the form does not pick this up
    Can anyone help me on this. I am using Forms 5
    thanks, Monica

    It would be very difficutlt to send all the necessary pieces but there is a very good discussion of it in the "Advanced Forms and Reports" book from Oracle Press(Chapter 4).

  • Data block based on procedure

    While working on a form with a data block based on a procedure, I keep getting error
    FRM-40364 The data type of item '%' does not match the corresponding column in the stored procedure.
    I have compared the items many times and found no mismatch. When the items are resorted (in both the data block and the procedure) and everything is recompiled, the
    "not matching" item referenced sometimes changes, though the types have not been changed. Has anyone solved a similar situation?

    Hi,
    Yes I did use the wizard,
    I agve it the package.proc name for query.
    it pulled up the field delivery ID,
    Hit finish, because I do not need update/delete/inserts.
    the query data source columns and arguments was defaulted correctly.
    THe QUERY-PROCEDURE was built by default.
    It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
    DECLARE
    bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
    BEGIN
    hsm_wsh_del_util.do_query(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
    END;

  • Recommended best practice to fetch detail block based on procedure

    HI
    I am creating a detail block (Dept)based on procedure which will be populated from the value from master block 'Emp'.
    For example,
    Detail block 'Dept' will be populated by calling procedure populate_detail(:emp.empno in number,dept.deptno out number) .
    But what are the triggers I need to call to populate detail block and at which level?
    I was thinking to call a WHEN-MOUSE-DOUBLECLICK on master block 'Emp' level to populate the detail block 'Dept' by calling the procedure and passing emp.empno as the parameter whenever the user moves from one master record to another.
    Please advise.
    Thanks in advance.

    Download the forms 6i examples CD from the OTN website

  • Help with Data Block Based on Procedure--getting compilation error

    I am trying to create a datablock based on a procedure , but im getting errors in compilation:
    Errors are :
    1) identifier 'HSM_WSH_DEL_UTIL.DEL_TBL' must be declared
    2)PL/SQL ERROR 320 at line 7, column 27
    the declaration of the type of this expression is incomplete or malformed
    ANy Help would be appreciated !
    Heres my pkg spec and body for the data block:
    CREATE OR REPLACE PACKAGE hsm_wsh_del_util IS
    TYPE del_record is record
    (delivery_id number);
    TYPE del_tbl is table of del_record INDEX BY BINARY_INTEGER;
    procedure do_query(p_del IN OUT del_tbl);
    END hsm_wsh_del_util ;
    CREATE OR REPLACE PACKAGE BODY hsm_wsh_del_util IS
    procedure do_query(p_del IN OUT del_tbl)
    IS
    idx number :=1;
    CURSOR DELIVERY IS
    SELECT DELIVERY_ID
    FROM abc_deliveries;
    begin
    FOR CUR IN DELIVERY LOOP
    p_del(idx).delivery_id :=cur.delivery_id;
    idx:= idx+1;
    END LOOP;
    end do_query;
    END hsm_wsh_del_util;
    Edited by: 981170 on Mar 13, 2013 1:08 PM

    Hi,
    Yes I did use the wizard,
    I agve it the package.proc name for query.
    it pulled up the field delivery ID,
    Hit finish, because I do not need update/delete/inserts.
    the query data source columns and arguments was defaulted correctly.
    THe QUERY-PROCEDURE was built by default.
    It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
    DECLARE
    bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
    BEGIN
    hsm_wsh_del_util.do_query(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
    END;

  • Block based on procedure

    I have a created a pacakage
    Pacakage specification
    TYPE ERROR_REC IS RECORD
    ( ID tbl.ID%TYPE,
    ORGL_STAMP tbl.ORGL_STAMP%TYPE,
    ORGL_USER tbl.ORGL_USER%TYPE,
    DEL_FLG tbl.DEL_FLG%TYPE,
    START_DT tbl.START_DT%TYPE,
    END_DT tbl.END_DT %TYPE);
    -- cursor variable to be used in do_query_cur procedure
    TYPE ERROR_ref IS REF CURSOR RETURN ERROR_rec;
    BODY
    PROCEDURE do_query_cur(ERROR_set IN OUT ERROR_ref,
    pid IN tbl.id%TYPE) IS
    BEGIN
    OPEN ERROR_set FOR
    SELECT ID,
                        ORGL_STAMP,
                        ORGL_USER,
                        DEL_FLG,                     
                        START_DT,
                        END_DT,
    FROM TBL
    WHERE id = p_id;
    END;
    END Ap_Comm_Error_Pkg1;
    I have based a block on the Ap_Comm_Error_Pkg1.do_query_cur. When I try to execute it from forms it
    returns 'error 40305 query caused no dtat to retrive. What could be the problem please help.
    Thx
    KK

    You pass pid argument, then you use p_id in your query.
    Francois

  • Querying Block Based on Procedure

    I built the form based off the following thread:
    Form based on stored procedure
    However, the block created by the procedure does not appear to be queryable with any given criteria. Query Enter, enter criteria, Query Execute didn't work it still returns the all the data. I also tried putting in a default where clause, but that didn't work. Is there a way to query the result set returned?
    Thanks,
    Roschera

    Okay, now I've tried adding data source arguments to pass in a parameter to the cursor being used to generate the data. I've set the default value to null and double checked to make sure the same data types are being used, however, I'm still receiving an ORA-6502 error. Any help would be appreciated.
    Thanks,
    Roschera

  • Error While Creating Block on Package Procedure

    Hi
    When I try to create a block on a package Procedure I get the following error
    ifbld60.exe has generated errors and will be closed by Windows.
    You will need to restart the program.
    An Error log is being created,
    and forms closes.
    Is it something to do with Forms problem or with Windows? Is there a patch available for this problem or its a OS bug. The client I am testing this form from is Windows 2000 Professional.
    Thanks for your help
    Diogo

    Hi
    You cannot directly insert object in Stored Procedure universe,Whatever object you are using to define your derived table,you have to include all those objects into the universe first.
    From the below image you can see that i have 3 derived tables ,but whatever objects i am trying to use all those i have inserted into the universe.
    Try to build like this save and export.
    Let me know if you face nay error

  • Trapping exceptions/error messages on form based on procedure

    I am trying to display meaningful error messages when various exceptions arise. I have created a form based on a procedure and the procedure works and returns an exception where I want it.
    I have been trying to use the PL/SQL Button event handler to return an error message to the user, but have not succeeded. I have tried:
    doSubmit;
    exception
    when others then
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => '_STATUS',
    p_value => 'my error message';
    (I have run this code both with a return at the end and not.)
    This runs, but this return a page that says:
    Error: WWV-0000.
    (It does not display 'my error message'.)
    I have also tried, from the Portal FAQs:
    doSubmit;
    exception
    when others then
    wwa_app_module.set_target('myschema.MY_ERRORS.SHOW?p_arg_names=p_errcode&p_arg_values=-1',
    'GO');
    where my_errors is a dynamic page that displays an error message when you pass it a value, in this case, -1.
    I get the following error message from this code:
    PLS-00201: identifier 'WWA_APP_MODULE.SET_TARGET' must be declared
    I did find some discussions on problems with exceptions when you have a form based on a procedure, but these were from 2001. Any help with this or directions to documentation would be greatly appreciated.

    I worked out one answer: the code provided by Oracle for the second example omitted the portal schema qualifier on the wwa_app_module. It should be (for 10g release 2, at least)
    PORTAL.wwa_app_module.set_target('myschema.MY_ERRORS.SHOW?p_arg_names=p_errcode&p_arg_values=-1',
    ^^^^^^^^^^
    'GO');
    This worked, and returned the custom error message.
    I still can't figure out why the p_session.set_value returns an error message that's just WWV-0000, but I would like to. Any help, even just what page in what document to look at would be appreciated.

Maybe you are looking for

  • Newsletter Template / Page set up for print

    Hi, I'm in the process of creating a template for a newsletter, and am not sure how best to start with formating this template so it will be suitable for sending to a printers for a run of about 500 copies each time. The newsletter will be A4 in size

  • Best practice: SelectOneChoice containing 'ALL'

    Hi, I'm having a selectOneChoice component, containing several departments. The component also contains a selectItem 'ALL'. Between the departments VO and the emp VO a view link has been defined, so after selecting a departments, the underlying emplo

  • Logical translation of nested logic:equal tags ?

    I see this in a JSP (I've simplified it) that I have to modify: <logic:notEqual name="someForm" property="XYZ" value="4"> <logic:notEqual name="someForm" property="XYZ" value="5"> <logic:notEqual name="someForm" property="XYZ" value="5"> <TD>String 1

  • Help to get Confirmati​on for service :(

    Hi I just start Blackberry 8900 curve I send request to my mobile company but they told me it activated and my mobile have problem but I didn't git amsg confirm agree to activating my service the edge small liter I turn off my mobile many time with r

  • Resultset doesn't return anything

    Hi, all I'm using oracle9i Jdeveloper 9.0.3 preview version. When I ran a sql statement, it didn't return anything to my resultset. I wonder if you guys have any idea what's going on here. I tried the same sql statement in SQL Plus, it was working an