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

Similar Messages

  • 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

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

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

  • 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

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

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

  • 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

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

  • ERROR FRM-40735 while migrating from 6i to 9i using FMA

    Hi,
    We have migrated a sample form which is in 6i to 9i using Oracle Forms Migration Assistant. It is compiling without errors and while running hitting the error
    FRM-40735:PRE-FORM trigger raised unhandled exception ORA-06508.
    and not opening up the form...Please post any suggestions on this.
    madhu.

    Thank you very much for the help...I could resolve it by just adding the appropriate pll's in forms90 folder.
    Now, we are trying to implement the calender in forms 9i. As we are moving from Forms 6i C/S to Forms 9i, as a first step I've implemented calender in web forms 6i (using demo's in oracle doc's--using CalenderWidget Bean)
    I tried doing the same for Oracle 9i too but it didn't work..I mean it is deleting the code for the trigger
    WHEN_CUSTOM_ITEM_EVENT which is written for Bean.
    Please suggest me regarding how to proceed with this...
    thank you
    madhu.

  • Error frm-41211

    hello friends when i am using the following code
    report_id Report_Object;
    ReportServerJob VARCHAR2(100);
    BEGIN
    report_id:= find_report_object(‘MyReport1’);
    ReportServerJob:=run_report_object(report_id);
    END;
    i am getting the following error
    frm-41211 integration errror

    This could be caused by:
    -- Calling Graphics runtime a second time when the first runtime is still open (see Note 15219.1)
    -- Failure to set environment variables TK2_PRINT_STATUS
    PRINTER, or DISPLAY (see Note 1031534.6)
    -- Calling OG_QUIT from Forms6i running on the Web (see Note 222334.1)
    -- Memory Problems: Your PC must have an adequate amount of available RAM to run Forms, as well as the runtime of
    the product you are integrating. Even though your PC may have a large amount of total RAM available, there still may not be enough real memory available to start another
    Windows task. See Note 164945.1
    I also suggest that you upgrade to the latest patch because there are various bugs filed where this error is produced that are fixed in later patches. For example, see bug 1872955.

  • Test.fmx gives error: "FRM-93500"

    Hello all,
    i have problem with oracle forms 11g, when i try to run test.fmx; in IE8 it gives this error="FRM-93500", on the other hand in FF 3.6 want to some plug-in but it doesn't solve automaticlly.In forms 11g all cofiguration are default.
    OS server 2008
    J2SE Runtime Env. 5u15
    Java SE dev. kit 6u12
    Thanks in Advance..

    port: '8888', it didn't give any error, when installed app.
    sorry sarah. how can i replace jvm.dll, i find 5 diff. jvm.dll, diff. location.

  • Error :::::::::; FRM-92090 : An unexpected error occurred

    Dear Sir
    I get error in Oracle 11i (ERP)Application.
    When I open application there is no problem , when I close the form and try to open an other one then get the following error ----
    FRM-92090 : An unexpected error occurred
    Thanks in Adv

    Urgent Reply this Forum Please !!!!!!!

  • Oracle forms 6i error FRM-42401

    i have created a master detail module and when trying to run it, it doesn't come with data when clicking on "execute query"
    Instead it displays error
    "FRM-42401 Performing program trigger ON_CLEAR_DETAILS on form"
    can someone pls help to get rid of this error

    Try out,
    after you compile all again your form:
    in WHEN-NEW-FORM-INSTANCE
    Go_block('your-MASTER-block');
    Execute_query;
    and see what happen(I think, your focus go on Detail-block and when you click F8(excute-query) error happen )
    Regards .. hope helps

Maybe you are looking for

  • After Effects CC // Adobe Media Encoder won't export H.264 mp4 files

    It stops immediately after "Reading XMP", having exported a defective file (200 kb, about a second long). I've tried several presets in this category. Is it a codec problem? What could be the cause?

  • C7 log problem

     When I go to my phone log I've found that although the setting is for keeping calls for 30 days everything disappears after 1 day. All was fine until last week and then out of blue it does not keep log more than 24h.

  • Sap Script - How to show two logos consecutive in a row.

    Hi All, If in a window I insert two lines: /: INCLUDE ZHEX-MACRO-ZLOGO001 OBJECT TEXT ID ST /: INCLUDE ZHEX-MACRO-ZLOGO002 OBJECT TEXT ID ST the Sap Script shows two logos not consecutive in a row. I'd like to show the two logos in the same row and i

  • Unable to view Portal Resources from the Portal Administration console

    Hi, When I trying to view the portal resources I got an empty page and the following exception: <Apr 5, 2007 11:22:38 AM GMT+08:00> <Error> <netuix> <BEA-423168> <An exception or error occurred in the backing file [com.bea.jsptools.interaction.backin

  • Problem with capturing event in object

    I am developing the dreamweaver extension for our project. In that i have a requirement of loading the images from the server and showing the images as thumbnails. I am using the flash player embedded into the dreamweaver ui. I am directly loading th