Filling datarows before creating a new record  frm-40735 ora-01422

Hello
I want to create a user-control table where I Store in the Mastertable the user informations. in the 2 detail tables I store the programmnames of the first level, in the second table I store the name of the form and if the user is allowed to insert, amend or delete.
I use a Master/2 Detail-Form. When I create a new record in the master block, I want to fill in the first and second detail block, informations of another user of the 2 detail tables. therefore I created a when-new-block-instance trigger with the following code:
select programm
into :k_zugriff.Programm
from k_zugriff, K_benutzer
where r_benutzer_zaehler=k_benutzer.zaehler
and oracle_user='ROBERT';
because this sql serves more than one row I receive the error code frm-40735 ora-01422
so how could I solve the problem to insert 5-10 rows in :k_zugriff.Programm. I can not make an insert before I go to the block k_zugriff, because the user number is not commited known. Also I want to commit the form when all informations are filled in. in case of a mistake I want to exit the form with no commit;
has anyone a usefull Idea?
regards
robert

it works thank you. where can I get further information about this technik. are there any turtorials or something where I get information how to build this complex forms??
right statement
DECLARE
CURsOR cr IS
select programm
from k_zugriff, K_benutzer
where r_benutzer_zaehler=k_benutzer.zaehler
and oracle_user='ROBERT';
BEGIN
FOR rec IN cr LOOP
IF :SYSTEm.RECOrD_STATUS!='NEW' THEN
CREATE_RECORD;
END IF;
:k_zugriff.Programm:=rec.PROGRAMM;
END LOOP;
END;

Similar Messages

  • Error frm-40735 ora-01422

    Hi,
    I have two tables:
    dept(
    dept_name VARCHAR2(10),
    dept_info VARCHAR2(10),
    CONSTRAINT dept_pk PRIMARY KEY (dept_name)
    location(
    loc_name VARHCHAR2(10),
    loc_info VARCHAR2(10),
    dept_name VARCHAR2(10),
    CONSTRAINT loc_pk PRIMARY KEY (loc_name),
    CONSTRAINT loc_fk FOREIGN KEY (dept_name)
    REFERENCES dept (dept_name)
    dept has the values ('dname1', 'dinfo1'), ('dname2', 'dinfo2'), ('dname3', 'dinfo3')
    location has the values ('locname1', 'dname1', 'linfo1'), ('locname2', 'dname2', 'linfo2'), ('locname3', 'dname2', 'linfo3'), ('locname4', 'dname3', 'linfo4'), ('locname5', 'dname3', 'linfo5'),
    I have a data block based on the location table. I also have a command button with the WHEN-BUTTON-PRESSED trigger:
    BEGIN
    SELECT loc_name, loc_info
    INTO :DATABLOCK.LOC_NAME, :DATABLOCK.LOC_INFO
    FROM location
    WHERE dept_name = :DATABLOCK.DEPT_NAME;
    END;
    If I try to do a search for a dept_name that has only one value in location, the Form will work properly and retreive that row. However, if I do a search for a dept_name that has two or more values in the table, I get the FRM-40735 ORA-01422 ERROR. I can tell that the Form will not allow me to retreive more that one row at a time, but what is a way that I can retreive more than one row at a time? I have set the datablock to Tabular and display 10 records, so it could retrieve the right amount of rows. Please help.

    I have a data block based on the location table.So do you want to show all the locations in that block which match the given DEPT_NAME ?
    If your block is based on the location-table you would just set the WHERE-condition on that block and do a requery, there is no cursor needed for that, so try the following code in your WHEN-.BUTTON-PRESSED-trigger.
    SET_BLOCK_PROPERTY('LOCATION', ONETIME_WHERE, 'dept_name=' || DATABLOCK.DEPT_NAME);
    EXECUTE_QUERY;If you have to use a select to do something other with the result than populating the block, then for a select returning more than one row, you have to use a cursor, something like:
    DECLARE
      CURSOR crDept IS
        SELECT loc_name, loc_info
          FROM location
        WHERE dept_name = :DATABLOCK.DEPT_NAME;
    BEGIN
      FOR rec IN crDept LOOP
        IF :SYSTEM.RECORD_STATUS!='NEW' THEN
          CREATE_RECORD;
        END IF;
        :DATABLOCK.LOC_NAME:=rec.LOC_NAME;
        :DATABLOCK.LOC_INFO:=LOC_INFO;
      END LOOP;
    END;

  • FRM-40735 / ORA-01422

    Hello
    i have the following:
    CREATE TABLE INSP_EQUIPMENT_TYPE
      EQUIPMENT_TYPE_D  NUMBER(11)                  NOT NULL,
      EQUIPMENT_TYPE    VARCHAR2(50 BYTE)           NOT NULL,
      PRIORITY_ID       NUMBER(11)                  NOT NULL,
      PARENT_ID         NUMBER(11),
      LICENSE_FLAG      CHAR(1 BYTE)                NOT NULL,
      BEND1             VARCHAR2(30 BYTE),
      BEND2             VARCHAR2(30 BYTE),
      CLASS_ID          NUMBER(11)
    ALTER TABLE INSP_EQUIPMENT_TYPE ADD (
      CONSTRAINT INSP_EQUIPMENT_TYPE_PK PRIMARY KEY (EQUIPMENT_TYPE_D);
    ALTER TABLE INSP_EQUIPMENT_TYPE ADD (
      CONSTRAINT CLASS_ID_FK FOREIGN KEY (CLASS_ID)
        REFERENCES INSP_CLASS (CLASS_ID));
    ALTER TABLE INSP_EQUIPMENT_TYPE ADD (
      CONSTRAINT INSP_FK35 FOREIGN KEY (PRIORITY_ID)
        REFERENCES INSP_EQUIPMENT_PRIORITY (EQUIPMENT_PRIORITY_ID));from 1 single record insertion i got the above error.
    Regards,
    Abdetu..

    Sorry i didn't ..
    Well the stranger i have no Trigger on that datablock or the table.
    i have the only trigger on my form that displays the message from a table that have the common FRM messages that may be handeled.
    Any way the following is in ON-MESSAGE Trigger:
    DECLARE
         TEMP NUMBER;
         TEMP1 NUMBER;
         alert_result number;
         alert_message varchar2(200);
    begin
         TEMP1 := message_code ;
         select count(*)
         into   temp
         from   cde_message
         where  msg_code = temp1;
         If temp = 0 then
              alert_message := message_type||'-'|| To_Char(message_code) || ': ' || message_text;
         else
              select msg_desc
              into   alert_message
              from   cde_message
           where  msg_code = temp1;
         end if;
         Set_Alert_Property ('NOTE',ALERT_MESSAGE_TEXT,alert_message);
         alert_result := Show_Alert('NOTE');
    end;Got the following Error
    On message Trigger FRM-40735 caused unhandeled exception.ORA-01422
    Regards,
    Abdetu..

  • JDeveloper 10g Creating a new record with trigger sequence primary key

    Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help.
    I am using a struts Data Action to create a new record in the database and then being forwarded to an edit page where I can enter the new details. Then when the details are entered I am clicking an update button and returning to a browse screen where I can either commit the change to the database or rollback. Sounds pretty simple but I am really struggling with trying to get the trigger of the number sequence to work properly.
    Ideally I would like to click the create new record button and then the primary key/triggered sequence number is already displayed on the empty form...
    ... but if this is too tricky or not possible then I would like the user to either not enter any value in the key field (which currently causes error - JBO-27014: Attribute PoNo in PO_SYS_MODULE.PoSystemView1 is required) OR the user enters a number and the trigger overwrites this number with the next in the sequence.
    I can enter a new record if I look in the manager console and see the next number in the sequence and then create the record using this number and then click commit twice, as the first time I get the error: JBO-25019: Entity row of key oracle.jbo.Key[154 ] not found in PoSystem. Or if I enter a value 5 times greater than the next in the sequence I have to click the commit button 5 extra times to get the sequence to match the input.
    I hope that this lengthy explanation fills you in on my problem, there must be a simple solution to this and I will be VERY grateful to anyone who can help me.
    Many thanks
    Ben Sayers (clearly a newbie)

    Hi,
    ADF Business Components handles this for you - unless yo prefer doing this manually. In the Entity Object, set the PK attribute's type to DBSequence. Then create a database sequence and use a database trigger to add the sequence value on insert
    Frank

  • Need help to create a new record in mdm using java webdynpro

    hi all,
    I have to develop an application to create a new record in mdm by using java WebDynpro  . Please help me what is the process that i have to follow to do this and provide me if you have any step by step guidance for this.
    thanks & regards,
    Mahi.

    Hi,
    The below link will help u to make the application in JAVA webdynpro
    The article has code to for creating records.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/803e9e80-21f4-2a10-8cbf-bcf6a8060be3
    Hope this may help u .
    Rgds
    Ankit

  • When creating a new record in a list, I want to create a new record in another list, too, together with the ID of the first record

    OK, for anyone who has ever programmed a database, this one is easy. However, I am EXTREMELY limited. I work with SharePoint 365 (2013). I am pretty proficient in a number of programing languages, but I really don't know how to program SP. I wouldn't even
    know where to put code.
    Say, I have two lists: List A, with Items A1 (ID), A2, A3 and List B, with Items B1 (Lookup to A1), B2, B3. What I want this: When I create a new record in List A I want that also an empty record (except for the B:A1 item) is created. Is that possible without
    any major programing?

    you can create a workflow to achieve your requirement
    http://sharepoint.stackexchange.com/questions/50059/create-a-list-item-when-item-is-created-in-another-list
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Create a new record in transformation

    Hi there,
    I would like to create a new datarecord, in a start/end routine or in a characteristic transformation routine. I am loading data from one cube to another.
    I have, say, a data structure looking like this:
    GL_Account; Fiscyear; Version; Amount
    111000;          2008;      01;         100.000
    I want to, based on this record, create a new record where version gets a new value (ex: 10, instead of 01), so the new record would look like, eg,:
    GL_Account;  FiscYear; Version; Amount
    111000;          2008;       10;        100.000
    What would be the best way of doing this?
    Thanks for your help.
    Jon
    I'm on BI 7.0

    Hi,
    Do this in End routine of Transformation,
    data:
              itab type tys_tg_1,
              it_resultpackage type tyt_tg_1.
        append lines of RESULT_PACKAGE to it_resultpackage.
        loop at it_resultpackage assigning <RESULT_FIELDS>.
        if <RESULT_FIELDS>-version = '01'.
            <RESULT_FIELDS>-version = '10'.
                append itab to RESULT_PACKAGE.
          endif.
          clear <RESULT_FIELDS>.
        endloop.

  • About create a new record in MM01

    hi,all
    I have created a new record of MARA-MATNR = 'Raffin_001' in MM01.
    But I don't know how I can find some fields like "MARA-WRKST".
    Can I write
               UPDATE MARA
                  SET WRKST = 'XXX'
                WHERE MATNR = 'Raffin_001' "
    to replace it?
    Is it right?

    Hi,
    WRKST - Is the field name for Basic material
    Basic Materia is defined in OMT6 tcode
    Path - LG - MM - Settings for Key fields - Define Basic Material.
    After defining in the SPRO settings then you can enter this basic material in BASIC DATA 2 under basic material field for the material code you wanted.
    Thanks & Regards,
    Kiran

  • Generate extra record when create a new record in secondary form

    I have been troubshooting this for a logn time:
    I have exemption form ties to exemption table. because there are two many info on exemption form, I create a second form called exemption (2) form and ties to exemption(2) table. Then, I create a "Go to exemption(2) form" button from the first form and it will redirect the user to the second form once they click it.
    Once the users complete the second form entry, and click the Create(which is the save record) button, it not only creates a new record in exemption (2) table but also create an extral record in the first exemption table.
    I used the exemption sequence to genertate the id so for example,
    Exemption (1) has 3 records so far, but after the user add the record in the second form, Exemption (1) has 4 records.
    How do I make the first form and the second form consistent in the ID?
    Thanks so much in advance!

    Thank you Tauceef for your help,
    If I get your problem exactly, you are using a sequence for the ID, and you want to insert the same ID in both Tables 1 & 2 - Yes, it is exactly what I want to do
    for that what you can do is, in the first form submit process, you can assign the sequence value to a hidden or application - I use exemption sequence and the first form takes nextval of it.
    item in your first form and use that item in your second form. - then, I went to the second form, and assign the ID to the first form ID (the page item in application)
    I got error message saying can not insert NULL value to second table, can not process the row.
    Can you show me the submit process in the first form?
    Hope it won't take too much of your time,
    Kitty,

  • I have added a new field in IT0006 ,Now when try to create a new record for

    Hi Experts,
    I have added a new field in IT0006 ,Now when try to create a new record for a employee.
    1,If I give the SUBTY in the PA30 screen getting an error "Don't Specify a subty error"
    if and remove the subty and press CREATE button popup's comes and list the subty values.......It was allowing me to enter the subty in the PA30 screen prior to my new field addition in IT0006... is't a problem with the new field addition?
    2, After I choose the subty value from the pop-up I am able to see the next screen....BUT GETTING AN INFORMATION MESSAGE THAT "Assignment to feature P0006 did not take place"?
    3,, In the next screen after I have passed all mandatory fields while attempting SAVE I am getting an error called " Time constraint table in T777D is incorrect" what could be the cause?

    How are u adding fields to table using append in se11 or pm01.
    if you are adding fields using se11 delete it and add it0005 in transaction pm01 and generate object.
    add fields to structure CI_XX_R0005 and generate screen and maintain entry and screen in maintance view add entry and activate program.

  • Populate fields when creating an new record

    Hello,
    When I create a new record from an other record type (ex: a service request from a task), I would like to pre populate some fields which are common to the task and the SR (ex: Owner, Account, Contact) and already on the task record.
    I have read that I could use the joinfieldvalue function with the post default activated.
    But the fields Owner, Account and Contact are read only picklist on the service request record and I am not allowed to use the default feature...
    Could you help? Do you have any idea?
    Thanks in advance
    Laurent

    Hi, As a service request can have multiple activities and you dont have the activity field (primary) in the service request, i dont think it is possible to acheive your requirement through JoinFieldValue. On the other hand if you like to default activity fields on basis of the associated SR to activity that is possible as the activity has the associated SR information. Hope it helps
    -- Venky CRMIT

  • Form Creating an new Record

    Hello,
    I have a simple form for entering records in a table. After entering data and pressing the create button it creates a new record. However it clears the fields for the next record to be entered. I've got two questions:
    1. If I want the form to stay within the new created record instead of emptiying the fields, how do I do that?
    2. Is there a posibility to search on a form? An example would be appreciated.
    Thanks in advance,
    Denes

    1. If I want the form to stay within the new created
    record instead of emptiying the fields, how do I do
    that?Ahh exactly the same question I was just searching for an answer to! =)
    Anyone got any ideas?
    - JMW

  • Web GUI new feature - creating a new record based on the current record

    Vincent,
    We need new feature in Web GUI:
    creating a new record based on the current record with data
    from Moscow with money

    It is already enabled, in the next release.
    If you joint TAB program, the march preview build contains it. User can select 1 or multiple users and make a copy.

  • Error frm-40735 ora-01403

    I read that this is a general purpose error for Forms, but I couldn't find an answer for my situation. I have a datablock based on a view, and a command button that has a trigger for selecting values into the block where one of the blocks fields matches those records. Here is the pl/sql code for the button's when-button-pressed trigger:
    BEGIN
    SELECT VIEW.ATTRIBUTE1, VIEW.ATTRIBUTE2
    INTO :DATABLOCK.TEXTFIELD1, :DATABLOCK.TEXTFIELD2
    FROM VIEW
    WHERE :DATABLOCK.TEXTFIELD = VIEW.ATTRIBUTE3;
    END;
    When I try to run this in Forms, I get the Error frm-40735 ora-01403. I can run similar code from SQL Plus. I would really appreciate some help.
    regards

    Let me give a better example: If I have two tables:
    create table dept (
    dept_no NUMBER,
    dept_name VARCHAR2(10),
    CONSTRAINT dept_pk PRIMARY KEY (dept_no)
    create table Location (
    loc_no NUMBER,
    loc_name VARCHAR2(10),
    dept_no NUMBER,
    CONSTRAINT loc_pk PRIMARY KEY (loc_no),
    CONSTRAINT loc_fk FOREIGN KEY (dept_no)
    REFERENCES dept(dept_no)
    and I create a master-detail form between the two. If I try to search by the loc_name, with the two tables joined by the master-detail, and have a trigger on a command button with the code:
    BEGIN
    SELECT d.dept_no, d.dept_name
    INTO :DEPARTMENT.DEPT_NO, :DEPARTMENT.DEPT_NAME
    FROM Location l, Dept d
    WHERE :LOCATION.LOC_NAME = l.loc_name;
    END;
    why do I encounter the error?

  • FRM-40735 ORA-01476

    I wrote this line in formula
    (:stot1+ :bottomcost.cmt1+ :bottomcost.cf1+ :bottomcost.oh1+ :bottomcost.ins1+ :bottomcost.naf1 + :bottomcost.com1) / nvl(:exc_rate,0)
    and there is no 0 Value but when I execute query then return this error
    FRM-40735
    ORA-01476

    I wrote this line in formula
    (:stot1+ :bottomcost.cmt1+ :bottomcost.cf1+
    :bottomcost.oh1+ :bottomcost.ins1+ :bottomcost.naf1 +
    :bottomcost.com1) / nvl(:exc_rate,0)
    and there is no 0 Value but when I execute query then
    return this error
    FRM-40735
    ORA-01476Never use / nvl(:exc_rate,0)
    If :exec_rate is null then you will get that error. Instead you use / nvl(:exc_rate,1) so if your divisor is = to zero you will return the value itself without dividing.
    Regards,
    Tony

Maybe you are looking for