FRM-40508

Oracle Forms6i

Hai All

I have an error when the iam, inserting data into a table through my forms.
I have two blocks in my form namely Leader, Member

It's my statement in my save button


If: Global.Mode = "QUERY" then

Update hierarchy_tree set = unitid: unit_id, empl_leader =: empl_code, empl_member =: emplcode.
fromdt =: from_date, todt =: to_Date;

elsif: Global.Mode = "Add" then

insert into hierarchy_tree (unitid, empl_leader, empl_member, fromdt, todt) values
(: unit_id,: empl_code,: emplcode,: from_date,: to_date);

end if;

commit;

I got data from two blocks.

When I press save button

I have an error
FRM-40508 oracle err could not insert the record.

Thanks in advance

Srikkanth.M

Published by: Srikkanth.M on May 10, 2010 12:37

Srikkanth,

Instead of

insert into H_Table (unitid,empl_leader,empl_member,fromdt,todt) values (:unit_id,:empl_code,:emplcode,:from_date,:to_date);

use

FORMS_DDL('INSERT INTO H_TABLE(UNITID, EMPL_LEADER, EMPL_MEMBER, FROMDT, TODT) VALUES(''' || :UNIT_ID || ''', ''' || :EMPL_CODE || ''', ''' || :EMPLCODE || ''', TO_DATE(''' || TO_CHAR(:FROM_DATE, 'DD-MON-YYYY') || '''), TO_DATE(''' || TO_CHAR(:TO_DATE, 'DD-MON-YYYY') || '''))');

So that we can change the insert / update statements according to our need. This means assign the insert in a variable and then run which insert statement using FORMS_DDL built-in.

Hope you understand.

Kind regards

Manu.

Tags: Oracle Development

Similar Questions

  • FRM 40508: cannot insert records

    Hello

    I get this error FRM 40508 in inserting data in any table through form 11 g.
    for example:

    my test table with two columns: id and name

    I wrote a simple insert statement
    Insert test values (: id,: name);
    commit;

    When I run the application and insert values, it displays the error above.

    When I use the errors in the display, it shows that there is violation: ora - 00001 (duplicates)
    However, there is no such value in the database.

    The same scenario is repeated with each painting I have. Help, please!

    Hello

    I was thinking the same thing as Andreas

    Why do you insert yourself when shape does it automatically. You use manual Insertion when you can't do by using the automatic feature of forms.

    Concerning
    SANAE

  • FRM-40508 cannot insert

    I have a table block. If I record a row in that record, it records.
    But if I fill more then a lines of the block it saye FRM-40508 impossible to insert. How do I solve this

    Gul says:
    I have a table block. If I record a row in that record, it records.
    But if I fill more then a lines of the block it saye FRM-40508 impossible to insert. How do I solve this

    Use the Menu Option or a key error display.

    The menu option or the display button will call a dialog window that will contain the SQL INSERT statement that forms seeking to run when the FRM-40508 error has occurred and the ORACLE error that has occurred.

    If the INSERT statement is too long to determine where the error has occurred, turn off the Table of Base property of elements not required in the block to shorten the INSERT statement.

    Show us the error...

    Hope this helps

  • error frm:40508

    Hi all

    I have a table in the table
    I have columns

    client_name
    customer_id
    customer_add
    customer_contact_no


    Hi HERE client_name is unique_key

    I want when I type client_name duplicates then (which is already stored in the database)
    message ("customer already exists '");

    but I get this error frm:40508

    Please guide
    Thanks and greetings
    Vikas

    Before INSERT trigger check if the customer already exists or not there then give a message like:

    declare
    
       cursor c_exists is
         select 1
         from customer
         where customer_name = :customer.customer_name;
    
    begin
    
       open c_exists;
       fetch c_exists into v_exists;
       close c_exists;
    
       if v_exists = 1 then
    
          message('customer already exist');
    
          raise form_trigger_failure;
    
       end if;
    
    end;
    

    You can also do the same thing is WHEN-VALIDATE-ITEM trigger for client_name.

    I hope this helps.

    Published by: Arif Khadas, April 15, 2010 16:10

  • FRM-40508: could not insert the record

    Hi guys,.

    I'm FRM-40508 when I press the ok button on my form.

    My ok button code is:

    BEGIN
    Do_Key ('Commit_Form');

    IF Form_Success THEN
    Hide_Window ('RELOAD_WINDOW');
    Go_Block ('CREATE_PLANS');
    ON THE OTHER
    RAISE Form_Trigger_Failure;
    END IF;
    END;

    Before going to the ok button, a when-validate-trigger fires in my block "CACHE_RELOAD".
    I launch my form in the debugger and found that there is no error in when-validate-trigger...

    It does not in a when-validate-trigger is:

    UPDATE system_parameters
    SET sysp_refdata_expires =: cache_reload.dsp_refdata_expires;

    But after it passes when-validate-item trigger, is faling in the trigger when-button-pressed the OK button.

    Strange thing, this is where he tries to update the system_parameters table, but when I check the display error in help, it shows the error:

    INSERT INTO SYSTEM_PARAMETERS (DSP_REFDATA_EXPIRES) VALUES (: 1).

    ORA-00904: invalid identifier of "DSP_REFDATA_EXPIRES".

    Now I'm confused why he tries to INSERT into the table of system_parameters rather than update as it appears in my query above.

    Why, he's trying to insert into the column dsp_refdata_expires when I am trying to update the sysp_refdata_Expires column in the system_parameters table.

    Table of System_parameters is not any column of dsp_refdata_expires.

    I ask all you form gurus for it please help me with this.

    The insert statement is generated by forms. I imagine that your block is based on a database table, and you insert new values. When you do the commit_form, this new record is sent with an insert statement in the database.
    I guess that this DSP_REFDATA_EXPIRES is not a table column.

  • How to handle the error FRM-40508

    Hello guys,.

    I try to display a message when this error occurs. I used the following code in my save button, it did not work.

    I use Developer 6i

    declare

    ERRCODE NUMBER: = ERROR_CODE;

    dbmserrcode NUMBER;

    dbmserrtext VARCHAR2 (200);

    Start

    IF errcode =-40508 THEN

    Message ("your number is too large. Try again. ") ; message(' ');

    end if;

    I used the positive value of the number, she also did not work. How to display a message?

    I also get an error if I want to use the form Builder Help and it opens using windows

    Do you have any idea how to solve such a problem?

    Do not include the code above in your backup

    At the outbreak of level-ERROR FORM, write the following code

    IF ERROR_CODE='40508' OR ERROR_CODE='40509' THEN
    
    Message('Your number is too large. Try again.');
    message(' ');
    
        raise form_trigger_failure;
    end if;
    

    I hope this works...

    Hamid

  • How to avoid the FRM-40400: complete Transactin: 1 sheet applied and saved

    Hello
    I have a form master detail.
    I'm not changing the main block, so I put it as non-editable.
    There is a push button. When I update or insert a new value into the details (tabular) block (: detail_block.text_item), I click on the button to make the change permanent in the database.
    At the beginning I had used standard.commit in the button, but that has not worked. By doing this, when I exist shape he even once asked me if I should commit (* do you want to save the changes you made? *).
    I then used commit in the push button. It is committed in the database but still promts me FRM-40400: complete Transactin: 1 sheet applied and saved. That I don't want.
    Could you please help me?

    concerning

    QGIRCO wrote:
    Hello

    try using the following code after validation;

    CLEAR_MESSAGE();
    

    I hope this will help u.

    Sarah

    Integrated Clear_Message will also work. But this is a problem with this integrated procedure. Suppose that you have used your code like this...

    COMMIT;
    CLEAR_MESSAGE;
    

    If for any reason any form triggers the error as FRM-40508: ORACLE error: unable to INSERT record. then the code above does not display this message in the status bar and user will think that the data is saved. But in the real world, there is error.

    And now, if you use the code as I said above she will hide this message * 1 sheet applied and saved etc... * and if there is an error in the form, then it will show in the status bar.
    ;)

    Hope that's clear.
    -Clément

  • How to get the item and block error

    Hello

    How can I get the name of the fault block and Item, in relaxation On Error at the level of the form. My goal is to change the error message based on the error code and the element that triggered the error.

    For example: If the error code is 40508 and the order of the day is: MyBlock1.MyItem3, the message will be "unable to insert record, unique values will be allowed MyItem3 into the MyBlock1".


    Thanks in advance
    Rizly

    FRM-40508 is a mistake that is triggered by a block, not by a point. So, it is right that there is nothing in the SYSTEM. TRIGGER_ITEM. Get an error message 'talking', you will need to use DBMS_ERROR_TEXT and DBMS_ERROR_CODE to check the database error (for example of a single key on your table)

  • DELETE_TREE_NODE

    Hi all
    I have a button on my form of the tree, I want to remove the node from the tree of the database and the tree order too.

    The following triger works very well...
    It removes the node from the tree the tree control
    DECLARE
          htree ITEM;
          top_node ftree.node;
          delete_node FTree.node;
          delete_value varchar(100);
          
    BEGIN
    delete_record;
    
    htree := Find_Item('TREE_BLOCK_TEST.TREE13');
          
    delete_value := :INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE;
    MESSAGE('delete_value'||delete_value);
    MESSAGE('delete_value'||delete_value);
    
    delete_node := Ftree.find_tree_node(htree,delete_value,
                                           Ftree.FIND_NEXT,
                                           Ftree.node_label,
                                           Ftree.root_node,
                                           Ftree.root_node);
    IF NOT Ftree.ID_NULL(delete_node) THEN
      Ftree.delete_tree_node(htree, delete_node);
    
    END IF;
          
    
    END;
    ---------------------------------


    But the following triger does NOT work...
    It removes the node from the tree of the DATABASE
    whenever I select the tree node, press THE BUTTON DELETE, I created, I got the following error:
    -----------------------------------

    FRM-40508 FRM-40508: could not insert the record
    You try to insert a record into Oracle Forms, but this attempt fails for some reason any.

    --------------------------------------
    DECLARE
         
      NODE FTREE.NODE;
      HTREE           ITEM := FIND_ITEM('TREE_BLOCK_TEST.TREE13');
       
    BEGIN
     
      NODE := :SYSTEM.TRIGGER_NODE; 
      FTREE.DELETE_TREE_NODE(HTREE, NODE);
      
      DELETE FROM INSP_EQUIPMENT_TYPE
      WHERE EQUIPMENT_TYPE_D = :EQUIPMENT_TYPE_D;
       
    
    END;
    I got some colleagues here a trigger that returns the lable of the tree in the text box, that I will put the value of the tree of as follows
     DECLARE
           HTREE$ ITEM := Find_Item('TREE_BLOCK_TEST.TREE13');
           
     BEGIN
          
    IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN
         
      :CONTROL.NODE_NUMBER := :SYSTEM.TRIGGER_NODE;
     
      :INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE  :=
      
       FTREE.GET_TREE_NODE_PROPERTY(HTREE$, :SYSTEM.TRIGGER_NODE, FTREE.NODE_LABEL);
       
     END IF;
     
    END;
    This is may be the cause, I can not yet return true pk or id that is stored in the database can someone help me pls.

    Kind regards

    Abdetu...

    What is the content of node_value? Contain the pk and nothing else?
    If you do

    DECLARE
      pk INSP_EQUIPMENT_TYPE.EQUIPMENT_TYPE_ID%TYPE;
    BEGIN
      IF Ftree.Get_Tree_Property('TREE_BLOCK_TEST.TREE13', Ftree.SELECTION_COUNT) = '1' THEN
        pk := ftree.get_tree_node_property(
            'TREE_BLOCK_TEST.TREE13',
            :system.trigger_node,
            ftree.node_value);
    message('pk: '||pk);
    message('pk: '||pk);
    
        DELETE FROM INSP_EQUIPMENT_TYPE
        WHERE EQUIPMENT_TYPE_ID = pk;
      ELSE
        Message('Please select a tree node for deletion.');
        Message('Please select a tree node for deletion.');
      END IF;
    END;
    

    then it should show you.

  • FRM-40301 query caused no records to recover - is lost

    Hello
    I have a form with 2 tabs. the first tab is based on a block of DB and the second tab is enabled only if no records are returned by the first tab. The form works fine. But if the user enters some criteria of the query, which does not have any matching record in the comic strip, in the first tab, the form returns no error message (FRM-40301 query caused no records to retrieve). I need a way to indicate to the user that no records have been retrieved.

    the trigger for the error to the form level is-
    DECLARE
         error_value   NUMBER (5) := ERROR_CODE;
         lv_errtyp       VARCHAR2 (3) := ERROR_TYPE;
         lv_errtxt       VARCHAR2 (800) := SUBSTR (ERROR_TEXT, 0, 100);
         dbmserrcode   NUMBER := DBMS_ERROR_CODE;
         dbmserrtext   VARCHAR2 (200) := SUBSTR (DBMS_ERROR_TEXT, 0, 100);
         alt_num            NUMBER;
         alert_is        alert;
         v_err             error_tools.error_rec_type;
    BEGIN
    
         IF error_value = 40735 THEN
              alert_is := FIND_ALERT ('ME_ERROR');
              SET_ALERT_PROPERTY (alert_is, alert_message_text, ERROR_TEXT);
              alt_num := SHOW_ALERT ('ME_ERROR');
    
              IF alt_num = alert_button1 THEN
                   RAISE form_trigger_failure;
              END IF;
         ELSIF error_value IN (41039, 42100, 40401, 40405, 40102, 41009) THEN
              NULL;
         ELSIF error_value IN (40202) THEN
              alert_is := FIND_ALERT ('ME_ERROR');
              SET_ALERT_PROPERTY (alert_is,
                                              alert_message_text,
                                              :SYSTEM.current_item || ' must be entered. ');
              alt_num := SHOW_ALERT ('ME_ERROR');
         ELSIF error_value IN (40508, 40509) THEN
              alert_is := FIND_ALERT ('ME_ERROR');
    
              IF dbmserrcode <= '-20000' OR dbmserrcode >= '-20999' THEN
                   SET_ALERT_PROPERTY (alert_is,
                                                   alert_message_text,
                                                   error_tools.get_oracle_error_desc (dbmserrtext));
              ELSE
                   SET_ALERT_PROPERTY (
                        alert_is,
                        alert_message_text,
                        lv_errtyp || '-' || TO_CHAR (error_value) || ': ' || lv_errtxt
                   );
              END IF;
    
              alt_num := SHOW_ALERT ('ME_ERROR');
         ELSE
              alert_is := FIND_ALERT ('ME_ERROR');
              SET_ALERT_PROPERTY (
                   alert_is,
                   alert_message_text,
                   lv_errtyp || '-' || TO_CHAR (error_value) || ': ' || lv_errtxt
              );
              alt_num := SHOW_ALERT ('ME_ERROR');
         END IF;
    
         error_tools.clear_errors;
    END;
    I checked if I catch any exception no_data_found in the form. In the query before relaxation so that DB, I have the following code: -.
    BEGIN
    some_code..................................
    
         BEGIN
              IF :exceptional_events.screening_group_num IS NULL THEN
                   SELECT scr.screening_group_num
                     INTO scr_group_num
                     FROM screening_groups scr
                    WHERE UPPER (scr.screening_group_name) =
                                   UPPER (:exceptional_events.screening_group_name);
    
                   :exceptional_events.screening_group_num := scr_group_num;
              END IF;
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   NULL;
         END;
    
    some_code.........................
    END;

    Hello!

    May your: system.message_level is set to something greater than "0"?

    Please try to catch the FRM-40301 in a trigger - MESSAGE like:

    begin
    if
     message_code = 40301
    then
      message ( 'Your Query returns no records. Please enter again or press STRG-Q to leave enter-query mode.' );
      message ( ' ' );
      clear_message;
    else
      message ( message_type || '-' || message_code || ': ' || message_text );
    end if;
    end;
    

    Concerning

  • Finally, mite update frm FF 3.6 at 14 for html5 (on the work of google last updated frm 3 to 5 services dint). will be history, bookmarks, site prefs etc be preserved?

    Finally, mite update frm FF 3.6 at 14 for html5 (on the work of google last updated frm 3 to 5 services dint). will be history, bookmarks, site prefs etc be preserved? probably used to active connections. extension & plugin compatibility is not really important.

    also, so simply, I hit update and do, will that opera-like "Firefox" menu appear or I have to do a clean install to get it?

    If you do the update of in Firefox bookmarks, preferences, history, etc. will be there. Active connections should work for most as well. The majority of your extensions and the plugin should work as well, but you may need to update after the update of Firefox.

    On Windows XP the menu Firefox is not by default, but if you want you can always enable it by going to view > toolbars and unchecking the menu bar

  • has been able to play gta vice city and san andras and now I changed the frm windows XP to 7. but now I'm not able to play another game

    original title: card__ graphic

    I was able to play gta vice city and san andras and now I changed the frm windows XP to 7. but now I'm not able to play any other game m .is it probkem of bone or my graphics card?

    -----------------

  • Frm net 3.5 install problem

    I also have a similar problem.  I had Mr. Fix It uninstall 2.0 so 3.5 can be loaded. There is a KB associated with 3.5 and install a 3 .exe files associated with the 3.5.  Not the case that I could find does say to install all or 1 or 2 of them before you run the installation of 3.5 or not. I have a 'watered' LM and want to uninstall (2008 version) for a worm to essenstials.  Where should I start? I guess I need atleast net frm 2.0?

    Hello

    You must install the previous version before installing .net framework was last updated.

    Follow the steps in the article, and check if that helps.

    http://support.Microsoft.com/kb/976982

    If the problem persists, follow the steps in troubleshooting section and check if that helps.

    http://support.Microsoft.com/kb/906602

  • I can't uninstall windows live frm my computer, I tried, and I'm not in my control panel, but still on my pc

    Hi I'm strees nw I'm tryin to uninstall windows live programs frm my computer so I can install new programs, but I can't do that I tried other ways but always get it can u pls help me.

    Hello

    Look for Windows live essentials

    Welcome to Windows Live Solution Center
  • How to recover frm the checkbox value

    Hello

    How to recover frm the checkbox value

    can someone help me on this topic

    Thank you

    Sujith

    CheckboxField class

    Boolean getChecked()

Maybe you are looking for