Frm-40508

Oracle Forms6i
Hai All
I have an error while iam inserting data into a table through my forms.
I have two blocks in my form namely Leader, Member
This is 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 have taken data from two blocks.
When i press the save button
I have an error
Frm-40508 oracle err unable to insert record.
Thanks In Advance
Srikkanth.M
Edited by: Srikkanth.M on May 10, 2010 12:37 PM

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 as per our need. That means assign the insert statement in to a variable, and then run that insert statement using FORMS_DDL built-in.
Hope you understand.
Regards,
Manu.

Similar Messages

  • [SOLVED] FRM-40508:ORACLE error: unable to INSERT record

    Hi all,
    I have migrated this form from 4.5 to 10g (Version 10.1.2.0.2 ). This form inserts a record into the database table when all the fields in the form are filled and a button Save is presed.
    At the time when I press the Save button, I get this error. FRM-40508:ORACLE error: unable to INSERT record
    So I went on to see the "Display Error" from help and found to be the database error, inserting into a table.
    The error message is ORA-00932: inconsistent datatypes: expected DATE got NUMBER
    The form where I press Save button has 3 date fields and I checked the properties of them and they are Date only.
    I also generated to object list report and tried to find some answer, but no use.
    Please help me in debugging this form.
    Edited by: Charan on Aug 18, 2011 4:05 PM

    I think you need to get a description of the table and compare all the "database" columns in the form with the ones in the database table to see that the types match. Somewhere there's a mismatch. Also check the block(s) "query data source columns" and see if there's any
    columns in there that the type does not match the table. (check the sizes of things too while you're at it.)

  • Oracle errors frm-40508 &ora-02291

    hello
    i m having a problem
    i have two tables for my project with one of em master and the other a detail one
    i m using developer 2000 for frontend
    when i try inserting data in the forms developed i encounter an error frm-40508 which says "unable to insert record" the corresponding ora error is ora-02291 which says "integrity constraint violated - parent key not found"
    i have a primary key in my master table which is used to connect it to details table through foreign key.feilds for the primary key in master and foreign key in details are same
    i dont have any such problem if i input data through sql command insert
    plz suggest me some solution to this problem
    thnx
    nipun

    Hi,
    Just try watching is therer ar no unique indexes on that table where u are doing an insert. another reason might be the composite primary key or the combination that might be confusing you.
    U can try out adding an exception block to the trigger and try raise when-dup-val-on-index exception
    Thanks,
    Vishal

  • Oracle forms error frm-40508: unable to insert record

    Hi Everyone,
    I have been having this problem for 2 weeks and I realize that I spent alot of time I couldn't get to fix the problem so I need your help.
    Here is my situation. First, I installed Oracle 10g in my laptop with Oracle forms10g and Oracle forms904i. I had oracle_home folder as the top level structure then I have inside oracle folder, Oracle10g in it own folder, Oracle9i release2 in it own folder. then I created the user account "student" using the system/manager account finally I granted privilleges as follow:
    GRANT ALL PRIVILLEGES
    TO student
    WITH ADMIN OPTION;
    this was working perfecty I didn't need to grant objects privilleges such as
    GRANT INSERT, UPDATE, DELETE
    ON customers
    TO student;
    Then I created a form Application prototype and it works well I could Insert, Update and Delete but now I am creating an e-commerce application prototype I created an new account using a system/manager account as I did previously and grant all privilleges. When I try to grant object privileges the message that I receive says ORA-01919 : role 'INSERT' doesn't exist
    When I run the application I am unable to insert the record through forms I get message frm-40508 Orcle error: unable to insert record.
    I deinstall the Oracle and clean my laptop and did a clean installation using only Oracle Server10g and Oracle Developer10g I am getting the same message frm-40508.
    Can someone please help me on this. the insert command that I am running is a simple one such as
    INSERT INTO customers
    VALUES( block_name.field_name, ....);
    COMMIT;

    frm 40735:When button pressed trigger raised unhanded exceptionplease help me to solve this>
    The FRM-40735 is a generic Unhandled Exception. Please post the full error message so we can better help you.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Unable to insert into table Showing error FRM-40508

    I want to insert data in text items of form into a table by using procedure in program unit. i declared all the parameters and calling this procedure in When-button-pressed trigger of push-button.it is not showing any compilation error, but run time error FRm-40508 ORACLE Error: Unable to insert the record.

    The Table Structure:-
    PROB_ID VARCHAR2(50)
    PERSON_NAME NOT NULL VARCHAR2(50)
    MODULE NOT NULL VARCHAR2(100)
    START_DATE DATE
    VERSION NOT NULL VARCHAR2(50)
    ASSIGNED_BY VARCHAR2(100)
    FUNCTIONALITY VARCHAR2(4000)
    ERR_TYPE VARCHAR2(150)
    ERR_COMPONENT VARCHAR2(100)
    ERR_LOCATION VARCHAR2(250)
    PROB_DESC VARCHAR2(4000)
    PROB_SOLTN VARCHAR2(4000)
    STATUS VARCHAR2(100)
    END_DATE DATE
    and the code is in When-button-pressed
    Declare
         v_pname char(5);
         v_mod char(6);
    v_datetime VARCHAR2(9);
    v_pid varchar2(50);
    v_version varchar2(50);
    v_assign varchar2(50);
    v_func varchar2(50);
    v_etype varchar2(50);
    v_ecomp varchar2(50);
    v_eloc varchar2(50);
    v_pdesc varchar2(50);
    v_psoltn varchar2(50);
    v_status varchar2(50);
    v_edatetime varchar2(50);
    uname varchar2(50) := 'fcclog';
    pwd varchar2(50) := 'fcclog';
    con varchar2(50) := 'orcl';
    cursor c1 is select prob_id from log_table;
    BEGIN
         -- Creating the unique Problem ID by adding all the item value
         v_pname := :log_table.pname_lst;
         v_mod := :mod_table.mod_name;
         v_datetime:= to_char(:log_table.start_date);
         --:log_table.prob_id := v_pname||v_mod||v_datetime ;
         v_pid := v_pname||v_mod||v_datetime ;
         for r in c1 loop
         if v_pid = r.prob_id then
              v_pid := v_pid + 1;
         end if ;
         end loop;
         :log_table.prob_id := v_pname||v_mod||v_datetime ;
         v_pid := :log_table.prob_id;
         -- Inserting into database--
         v_version := :log_table.version;
         v_assign := :log_table.assigned_lst;
         v_func := :log_table.funct_txt;
         v_etype := :log_table.err_type;
         v_ecomp := :log_table.err_component;
         v_eloc := :log_table.err_location;
         v_pdesc := :log_table.prob_desc;
         v_psoltn := :log_table.prob_soltn;
         v_status := :log_table.status;
         v_edatetime := :log_table.end_date;
         log_insert(v_pid,v_pname,v_mod,v_datetime,v_version,v_assign,v_func,v_etype,v_ecomp,v_eloc,v_pdesc,v_psoltn,v_status,v_edatetime);
         commit;
         exception
              when others
              then
              DBMS_OUTPUT.PUT_LINE(SQLERRM);
              rollback;
         end;
    And the Code in Procedure (log_insert) of Program Unit.
    PROCEDURE log_insert(
    p_pname varchar2,
         p_mod varchar2,
    p_datetime VARCHAR2,
    p_pid varchar2,
    p_version varchar2,
    p_assign varchar2,
    p_func varchar2,
    p_etype varchar2,
    p_ecomp varchar2,
    p_eloc varchar2,
    p_pdesc varchar2,
    p_psoltn varchar2,
    p_status varchar2,
    p_edatetime varchar2)
    IS
    BEGIN
    insert into fcclog.log_table(PROB_ID,PERSON_NAME,MODULE,START_DATE,VERSION,ASSIGNED_BY,FUNCTIONALITY,ERR_TYPE,ERR_COMPONENT,ERR_LOCATION,PROB_DESC,PROB_SOLTN,STATUS,END_DATE)
    values(p_pid,p_pname,p_mod ,p_datetime,p_version,p_assign,p_func,p_etype,p_ecomp,p_eloc,p_pdesc,p_psoltn,p_status,p_edatetime);
    END;

  • Error FRM-40508 - Please help urgent !!!

    Hi All,
    I'm trying to design a form (Forms 6i) having 3 data blocks. Values from 3 different table are returned to the related fields in the blocks. At the bottom of form, I've created a "push-button" to take these values and add into 4th table.
    I gete rror FRM-40508. I trapped error and found that its actually trying to insert into table of "First Data Block", which it should not. My Insert statement in the Trigger of push-button (when-button-pressed) doesn't refer to that table.
    However, I found that, in designer mode, if I click on the push-button I see the first block's name in the Block Name space (upper right hand corner). I don't understand this but feel that that is the problem.
    Please help ASAP.
    Thanks
    Prashant
    null

    Here is the fun.
    I created one more data block manually. Creted push-button and following insert stmt in "When-button-pushed" trigger. (real table names changed to dummy)
    ===========================================
    declare
    seqno number:=0;
    begin
    select DUMMY_SEQ.nextval into seqno from dual;
    insert into LOG_dummy(
    ID, GROUP_ID, ANSWER_ID, QUESTION_ID, ANSWER_TEXT
    values
    seqno,
    :sur.survey_id,
    :sur_ans.answer_id,
    :sur_quest.question_id,
    :sur_ans.answer_desc
    commit;
    clear_form(No_Validate);
    END;
    =============================================
    The error pops up because of "commit". When I pressed shift-F1 it shows that it can't insert into one of the data blocks. The insert stmt shown there is nowhere in my code of trigger. If I remove "Commit" from above, I Don't get error but record doesn't get inserted either in the table mentioned above :-(
    I don't understand what's going on... If anybody in US is willing to help, I can call and talk on phone. I've to finish it this week, any case and I'm stuck on this :-(
    ~ Prashant
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by ahmed gaber ([email protected]):
    are the 3 blocks related with 3 tables ,
    and you'r trying to insert the values in another table ?
    if yes : so what is the code you wrote in the trigger? to know the answer.
    and try to check if there is any not-null columns required ok//<HR></BLOCKQUOTE>
    null

  • Error frm:40508

    Hi All
    i have a table in that table
    i have colums
    customer_name
    customer_id
    customer_add
    customer_contact_no
    hI HERE customer_name is unique_key
    i want when i type duplicate customer_name then (which is already stored in database)
    message('customer already exist');
    but i get this error frm:40508
    please guide
    thanks and regards
    vikas

    In PRE-INSERT trigger check if the Customer already exists or not if exists then give a message as:
    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 is WHEN-VALIDATE-ITEM trigger for customer_name.
    Hope this helps.
    Edited by: Arif Khadas on Apr 15, 2010 4:10 PM

  • About the FRM-40508 ORACLE ERROR, Unable to insert'

    Dear Friends:
    I use the Toolbar button to insert one record -- do_key('CREATE_RECORD') in the Toolbar_actions procedure, and then, input the value for this record, and then, click the "Save" button -- commit_form; in the when_button_pressed trigger. There will be the problem FRM-40508 ORACLE ERROR, Unable to insert' .
    Please kindly help to fix it...........

    Hi,
    See...just for a test, please give whatever u input in the form, give the same in the sql query
    like
    insert into tablename etc in sql builder and see what happens,
    This error will come,
    if input value does not meet the datatype in the table or
    if u fail to input value for not null column or
    access rights pbm(check whether you have rights to insert in to the table)
    Regards
    Priya

  • Please help with FRM-40508 error

    Hello everyone.
    I designed a form. I get a frm-40508 error.
    Tables for this form are valid and exist.
    I have no idea what else could cause this error.
    Any suggestions are welcome.
    Thanks in advance,
    Sonya

    Hi
    Is the table you are trying to insert into in the same Schema as the user you are compiling and running the form as?
    eg. If you created the table as USER 'SCOTT', are you compiling and running the form as 'SCOTT'?
    If the schema is the same for the table creation and the compilation/running of your form then I'm a bit stuck.
    If, however, they are different then what you will need to do is grant a public synonym for your table and then grant Select, Insert, Update, Delete privelliges (as appropriate) to the user/role accessing the table/running the form.
    HTH.
    Simon

  • Urgent: frm-40508 error

    Hi I cannot commit to the database using the form I am working on. I have tried commiting using the SQL prompt and it works fine. The tablenames I am using in the form are dynamic, I am wondering if this could be the problem? Is there a certain way one must commit a record using forms if the table name is dynamic?
    ie: 'tbl_':global.envchg'_name'
    Thanks a bunch
    Sean

    I don't know where you are specifying the table name to use, but I guess it is in the form's block property sheet. In order to perform DML on a variable table I think you may well be beter to put the processing into a PL/SQL procedure in the On-Delete, On-Insert, On-Lock and On-Update triggers. This may use Dyanminc SQL or a series of IF/ELSIF statements to determine which table to use.

  • Handling oracle forms errors (frm-nnnnn) locally

    is there a way to handle an oracle form error (e.g. frm-40508) locally in a way similar to handle oracle database errors.
    e.g.
    procedure insert_something is
    insert_error exception;
    pragma exception_init(insert_error,-40508);
    begin
    :c1.a := 1;
    :c1.b := 2;
    commit_form;
    exception
    when insert_error then
    <handle insert error on c1 block>;
    end;
    Edited by: mojo on Oct 7, 2008 4:34 AM

    by locally i mean within the pl/sql block that will have raised the error.
    an example i encoutnered recently, but by no means the only occasion i have wished such things:
    function mseRecStatus returnvarchar2 is
    rtnChar varchar2(32);
    begin
    rtnChar := get_record_property(mouseRec,mouseBlock,status);
    return rtnChar;
    end;
    This is called from a pre-pop-menu trigger. mouseRec and block are calculated previously. A right-click on a record item below the last record raises error frm-40741 (unable to locate record on block). it would be nice to be able to do something like the following without incolving an on-error trigger:
    function mseRecStatus returnvarchar2 is
    rtnChar varchar2(32);
    non_record_clicked exception;
    pragma exception_init(non_record_clicked,-40741);
    begin
    rtnChar := get_record_property(mouseRec,mouseBlock,status);
    return rtnChar;
    exception
    when non_record_clicked then
    return null;
    end;

  • Update a single column in query only form

    Forms 9i, database 10g
    I am migrating the form from 6i to 9i. I have a form that is query only except for one field that can be updated. The main block1, based on a view, includes most of the person's personal data, none of which is updateable.. Another block2, based on a table, includes the 3 not-null colums that cannot be updated, and a remarks field, which can be updated. The block2 properties are set YES for insert, update, delete. The three non-updatable columns have properties set to NO for I,U and D, but the remarks column has I,U and D properties set to YES. When I enter data into the remarks field and press the Save on the Forms icon bar, I get error FRM-40508:unable to insert record and the ORA-00001:unique constraint. I don't should not be able insert and I don't want to, I just want to update one column.
    What am I not setting correctly in 9i? The same triggers and code works in 6i.
    Any suggestions are greatly appreciated.
    Vija

    No, there are no on-update triggers, but there are Post-Qry. I did run it in debug mode, but there is no good place to put a break point, since retrieval of the data works fine. Should I have key-commit trigger on the block to do the update?
    Vija

  • Not able insert ,query data from forms

    hi,
    I am not able to insert data or query data from forms(10g devsuite).getting error frm-40505,frm 40508 .i am able to insert and select record from sql plus.the block ihave created is control block .it is connected to the table using the properties.
    should i do anything to insert record.please help

    the block ihave created is control block .it is connected to the table using the properties.A Control Block, by definition, is a non-database block. This means the block is not directly connected to a table so you have to manually display data in the block and any DML you want to perform on data in this block you must do manually as well.
    There are four database objects you can base your database block on; 1) a Table, 2) a View, 3) From Clause Query (basically an In-line View), and 4) a database stored procedure. I recommend you use one of these four methods rather than manually display your data.
    Craig...

  • Unable to do UPDATE in Oracle Form 10.1.2

    Hi,
    I am using an LOV to query data from a master-type table.
    -- WHEN-BUTTON-PRESSED in button Retrieve
    declare
      l_number number;
      a_value_chosen boolean;
    begin
      a_value_chosen := Show_LOV('LOV_CUSTOMER');
      if not a_value_chosen then
        message('No value selected');
        raise form_trigger_failure;
      end if;
    end;First, I choose a value from the LOV. The LOV showed the selected items in the Form.
    Next, I modified some values (not the Primary Key) in the Form text items.
    Finally, I tried to Save the modification into table, using
    -- WHEN-BUTTON-PRESSED in button Save
      commit_form;
      clear_form;Surprisely, it showed
    FRM-40508: ORACLE error, unable to INSERT record.
    BTW,
    Previuosly, I can do UPDATE if I use the Enter Query and Execute Query button.
    I did not attempt to do inserting, just updating.
    Could someone show where is the problem?
    Is the form status not changed by the query returned from LOV?
    Any help would be grateful.
    Many thanks,
    Imelda

    Hi,
    Glad I found all of you in this forum.
    Thanks for all of the explanations.
    I thought by using LOV would suppress the network traffic.
    If the use of LOV would give lots of drawbacks, then I should see the Enter_Query() Execute_Query() instead.
    BTW,
    I found the button Enter Query and Execute Query on the toolbar.
    (Seems that Oracle Form provides lots of help to simplify the programming)
    I have some sort of problems in using them :
    1. Well, they do the query and retrieve the records for a match query criteria.
    But it did not give any specific message if the record does not exist.
    The message bar (for unknown reason) is showing
    "Enter a query; press CTRL+F11 to execute, F4 to cancel."
    Can we change this behaviour?
    Perhaps, showing "No record(s) are retrieved for this query. Either change the query criteria; press CTRL+F11 to execute, F4 to cancel."
    2. I found the Count Hits from Query menu.
    Based on the documentation, the message line will show the records number returned based on query
    criteria, without actually retruning the records to the user.
    I am not sure whether this function has been removed for the Oracle Developer 10g (10.1.2), since
    there is nothing happen, and the message line keep showing
    "Enter a query; press CTRL+F11 to execute, F4 to cancel."
    Do we tho do some modification to the Forms to use Count Hits?
    3. I read on the documentation about Query Where dialog box.
    Query Where will be showed if user enter a colon ':' in a field in Enter Query mode for query criteria.
    Again, I am not sure whether this function has been removed too.
    the message line showed :
    FRM-40367: Invalid criteria in field <field_name> in example record.
    It happens if the criteria contains # or : or &
    Or is it done via another way?
    Any help would be grateful.
    Many thanks,
    Imelda.

  • Forms 6.0.5.0.2: Problems with Oracle 7.3.4, OK with 8.0.5

    I have problems with Forms 6.0.5.0.2 running against an Oracle
    7.3.4 with Net8. When trying to insert or update records I get
    an FRM-40508: ORACLE error: unable to INSERT record/FRM-40509:
    ORACLE error: unable to UPDATE record. The Help | Display Error
    menu item shows statement = "S3AVWU3wo|$6o|" (garbled
    message), error = "ORA-12663: Services required by client not
    available on the server" (sometimes it's "ORA-01403: no data
    found").
    It works fine against 8.0.5. As far as I'm aware Forms 6 is
    certified against 7.3.4?
    Any clues?
    Thanks for your help.
    Finn
    null

    We had to upgrade from 7.3.2 to 7.3.4 when we moved over to Forms
    6.0.5.0.2 and it's working fine.
    We are using Net 8 as well.
    Finn Ellebaek Nielsen (ChangeGroup ApS) (guest) wrote:
    : I have problems with Forms 6.0.5.0.2 running against an Oracle
    : 7.3.4 with Net8. When trying to insert or update records I get
    : an FRM-40508: ORACLE error: unable to INSERT record/FRM-40509:
    : ORACLE error: unable to UPDATE record. The Help | Display Error
    : menu item shows statement = "S3AVWU3wo|$6o|" (garbled
    : message), error = "ORA-12663: Services required by client not
    : available on the server" (sometimes it's "ORA-01403: no data
    : found").
    : It works fine against 8.0.5. As far as I'm aware Forms 6 is
    : certified against 7.3.4?
    : Any clues?
    : Thanks for your help.
    : Finn
    null

Maybe you are looking for

  • Creating Forms (Text Fields)

    I am using Class Room in a Book "Adobe Acrobat X ISBN-13 978-0-321-75125-6.In lesson 10 page 253, I completed all the properties for the "Order_Start.pdf." when I entered data in the "price" and "quantity" the "total" for that line updated as usual;

  • Doubt in Programs

    Hi experts,     I have a doubt, in my program i created one parameter(Material description), but in output i need to display with lowercase..( when i type in lowercase, its converting into upper case) plz urgent. point will be sure. Thanks, Gowri

  • Wireless is not enabled

    Someone plzzzzzz... help me. I've spent hours trying to set the new lela up, but I am not getting anywhere. I am trying to connect my printer and other devices wirelessly, but I can't. When I had the old advisor, everything was connected beautifully.

  • IPhoto 11 sometimes fails to delete originals

    If I delete a large number of pictures in iPhoto 11 (drag them to the trash) they should be moved to the operating system's trash when the iPhoto trash is emptied, and then they should really disappear from the hard drive when the OS's trash is empti

  • Why is firefox opening off the screen and to the side in Windows 7?

    When I attempt to open FireFox 5 it hides off to the side and is therefore unusable. I have restarted the browser, rebooted the computer, and even reinstalled the program.