Error in a Trigger

the below error occurs when I delete from tabular form. I created the trigger to Log the Updates , adds and delete of the Name from the Tabular form.
<code>
CREATE OR REPLACE TRIGGER log_trg
BEFORE INSERT OR DELETE OR UPDATE ON subjects FOR EACH ROW
DECLARE
l_type VARCHAR2(50);
case1 VARCHAR2(50);
BEGIN
select caseno into case1 from cases1 where id = :new.caseid;
IF inserting THEN
l_type := 'Added Name:';
INSERT INTO log(caseid,CASE,author,whendone,changes)
VALUES(:new.CASEID,CASE1,'Admin',SYSDATE,l_type||:NEW.subjECTNAME);
ELSIF updating THEN
l_type := 'Updated Name:';
INSERT INTO log(caseid,CASE,author,whendone,changes)
VALUES(:new.CASEID,CASE1,'Admin',SYSDATE,l_type||'"'||:old.subjECTNAME||'"'||' to '||'"'||:NEW.subjECTNAME||'"');
ELSIF deleting THEN
l_type := 'Deleted Name:';
INSERT INTO log(caseid,CASE,author,whendone,changes)
VALUES(:old.CASEID,CASE1,'Admin',SYSDATE,l_type);
END IF;
END;
</code>
ORA-20001: Error in multi row delete operation: row= 2, ORA-01403: no data found ORA-06512: at "CASE.LOG_TRG", line 7 ORA-04088: error during execution of trigger 'CASE.LOG_TRG', delete from "CASE"."SUBJECTS" where "ID" = :p_pk_col
multi row operation failed

I am still getting the below error even after having it as :old.caseid.
ORA-20001: Error in multi row delete operation: row= 2, ORA-01403: no data found ORA-06512: at "CASE_MGMT.CHANGELOG_SUBJ_TRG", line 8 ORA-04088: error during execution of trigger 'CASE_MGMT.CHANGELOG_SUBJ_TRG', delete from "CASE_MGMT"."TBLSUBJECTS" where "SUBJECTID" = :p_pk_col
multi row operation failed

Similar Messages

  • Error -- No Such Trigger('when-button-pressed')

    Hi,
    I am getting the error ""No Such Trigger('when-button-pressed')"",
    when I am executing the code EXECUTE_TRIGGER( 'WHEN-BUTTON-PRESSED' );
    on some item(Key-Next-Item), although WHEN-BUTTON-PRESSED trigger exists.
    What could be the problem ?. It worked till yesterday, giving error from today, I havent
    changed any thing.
    Thanks in Advance
    Devender

    Steve's tip is the only good solution for this case.
    The problem in your case for example is:
    Let's say you have a block-trigger, which fires after your execute-trigger.
    Now a colleague of you, which don't know your code, create a WHEN-BUTTON-PRESSED on an item, then the new code is started and not the block-trigger-code.
    So, don't ever do this. Write your code in a package-function or -procedure and call it from the trigger. So you can re-user the functionality
    Gerd

  • Getting error while creating trigger!!

    Hi Guys,
    I am getting the following error while creating trigger in Oracle10g Database in TOAD environment.
    Error: PLS-00306: wrong number or types of arguments in call to '='
    Table details:
    One of the column having BLOB Data type in the table.
    In the trigger, I have compared :old and :new values.
    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_NEW(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    Any one knows about this issue, please let me know with the proper solution.
    Thanks for your immediate response!
    Regards,
    Lakshman

    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_AUD(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    I am getting the error in line at If condition
    Error: PLS-00306: Wrong number or tpyes of arguments in call '='
    Please let me know if any one knows exact solution!
    Thanks in advance!
    Regards,
    Lakshman

  • Query running ok in SQL but giving error in form trigger

    Hi guys
    here is the query
    SELECT NVL(BGM_PERAMT,0) INTO PERAMT FROM BROKERAGE_MASTER
    WHERE     BGM_BROKERAGETYPE = 'BR01' AND BGM_PERAMT <> 0
    The above query working fine in SQL but giving following error in when_button_pressed trigger
    [In a host language program, all records have been fetched. The return code from the fetch was +4 indicating that all records have been returned from the SQL query. ]
    please give me the solution for this problem.
    It is very urgent
    regards
    asha

    ok below is the code
    CURSOR RESALE_BROKERAGE IS SELECT am_brokerCd resalebrcd,'' resalesbrcd,NVL(SUM(AM_AMT),0) RESALE_AMT,COUNT(AM_RESALENO) TOTCNT,NVL(SUM(AM_UNITSAPPLD),0) RESALE_UNITS
    FROMRNT_RESALE_MASTER
    WHERE am_brokercd is not null AND AM_PROCTAG='Y' AND
    (to_date(to_char(AM_PROCDT,'DD/MON/YYYY')) BETWEEN
    to_date(to_char(:rnt_broker_date.fromdt,'DD/MON/YYYY')) AND
    to_date(to_char(:rnt_broker_date.todate,'DD/MON/YYYY')))
    GROUP BY am_brokerCd
    UNION
    SELECT AM_BROKERCD resalebrcd,     
    am_subbrokercd resalesbrcd,
    NVL(SUM(AM_AMT),0) RESALE_AMT,COUNT(AM_RESALENO) TOTCNT,
    NVL(SUM(AM_UNITSAPPLD),0) RESALE_UNITS
    FROM RNT_RESALE_MASTER
    WHERE     am_brokercd is not null AND AM_PROCTAG='Y' AND AM_BROKERCD = 'ARN-9760' AND (to_date(to_charAM_PROCDT,'DD/MON/YYYY')) BETWEEN
    to_date(to_char(:rnt_broker_date.fromdt,'DD/MON/YYYY')) AND
    to_date(to_char(:rnt_broker_date.todate,'DD/MON/YYYY')))
    GROUP BY AM_BROKERCD,am_subbrokercd;
    Asha

  • Error iviscope configure trigger

    Good morning,
    I have a problem with the Iviscope trigger configuration.
    I'm using a PCI-5105 Digitizers/Oscilloscopes to acquire 3 channels simultaneously.
    I use IVIscope vi to realize the program.
    Channels configuration is ok. But when I want to acquire the signals some problem happen.
    on version 1.1 of my program the 3 signals are ok but not at the same time. (frequency 1 kHz, voltage +4V, +1V and +2V)
    you can see Front panel v1.1 and diagramme v1.1
    I don't understand why the signals are not acquired at the same time ?
    so I do a second version using trigger vi. (see diagramme1 v1.2 and diagramme2 v1.2)
    in this case the signals are not correct (Front panel v1.2)
    here I want to use channel3 to trig the 3 other channels.
    and with this version, sometime an error message appear (error message Configure Trigger).
    Why the trigger channel doesn't work?
    Best regards
    Florent
    Attachments:
    diagramme1 v1.2.JPG ‏117 KB
    Front panel v1.1.JPG ‏186 KB
    diagramme v1.1.JPG ‏149 KB

    the other attach File
    Attachments:
    error message Configure Trigger.JPG ‏133 KB
    diagramme2 v1.2.JPG ‏94 KB
    Front panel v1.2.JPG ‏225 KB

  • Help me, why Oracle Application raised error:no such trigger.

    Dear friend,
    I have developed a form program in FORMs 6I, and it works in my ORACLE APPLICATIONS ,but after it is installed in another Server,it popup the error windown, it said : FRM-40700:No such trigger:menu_to_appcore.
    I don't know why, somebody told me ,the oracle application with different vesion will cause this problem, is it true?, if it's true, how can i avoid it if i have to use those triggers.
    Thanks a lot.
    regards,
    willen 2002/06/27

    Willen,
    I suggest you review the Oracle Applications Developer's Guide (http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115devg.pdf). More than likely, your form does not include one or more of the required libraries or other subclassed objects required for an Applications Form. I highly recommend you base any Custom Form on the provided TEMPLATE.fmb that comes with Apps. This will ensure you have all the required objects in your form and the library paths are neutral (no hard-coded file paths to the library - which could be the cause of your error).
    somebody told me ,the oracle application with different vesion will cause this problem,As to this statement, you need to contact your DBA or Apps Server admin to find out which version of Oracle Forms is installed on the Apps Server. Your development environment must match. For example, Forms 6i patchset 18 installed on the Apps Server, you should have Forms 6i patchset 18 installed on your workstation. It will work if your workstation has a lower version than the Apps Server, but you're asking for trouble if you have a newer version installed on your workstation.
    Hope this helps.
    Craig...
    P.S. The E-Bus Suite forum is the more appropriate forum for an Applications question. This forum is for non-EBS Forms development. :-)

  • Error while creating trigger

    Hai All
    I have table called Daily_attendance
    I need to track the changes made in the table..
    I have written a trigger
    create or replace trigger dail_attendance
    after delete or insert or update on Daiyl_attendance
    for each row
    begin
    insert into audit_dail_att_table(user_name,timestamp,emplcode,old_timein,new_timein,old_timeout,new_timeout,old_attend_date,old_attn_status,old_deptcode)values
    (user,sysdate,:old.emplcode,:old.timein,:new.timein,:old.timeout,:new.timeout,:old.attend_Date,:old.attn_status,:old.deptcode);
    end;
    show err;
    And i got the error
    Warning: Trigger created with compilation errors.
    Errors for TRIGGER DAIL_ATTENDANCE
    Thanks In Advance
    Srikkanth.M

    Hi Srikkanth,
    As karthik has pointed out you should decide on what needs to be captured in the audit tables...
    just to give a heads up...
    usually the audit tables contain all the info of main table + the audit_timestamp(when the change was made), the user who made the change and the operation(if it is delete/insert/update)..this can be obtained in the trigger using:
    If inserting...
    set operation = 'I'
    elsif updating
    set operation ='U'
    else
    set operation = 'D'
    end if;
    hope this gives you an idea...
    also now there are other methods of auditing like fine grain auditing and Change Data Capture, CDC is a good set up for auditing as far as i know...u should think of what is best for your application...
    Edited by: Roy Mathew on May 27, 2010 3:51 AM

  • Error in Creating Trigger

    Hi All,
    I have a problem in creating a trigger.
    I have two fields named last_updated_by, last_updated_date which
    r common to all the tables.
    If the user made any change to the exiting record, the values of
    the those two colums should get changed automatically with the
    username and sysdate.
    When I wrote a trigger its giving mutation error.
    Can I update these value by stored procedure via trigger?
    I heard its possible by DBMS_JOB package. Can anyone give idea?
    Thanks in Advance.
    Regards
    Gopinath Kona

    You should only get the mutating table probllem if you're doing
    SELCT or DML against the table the trigger's built on. Which
    suggests that you're approaching this the wrong way.
    Try CREATE TRIGGER blah blah
    FOR EACH ROW
    :new.last_updated_by := USER;
    :new.last_updated_date := SYSDATE;
    END;
    If that's what you are doing then the problem lies elsewhere.
    Rgds, APC

  • Error while generating trigger

    The Triggers PL-SQL code generated is as follows
    create trigger GROUPS_INS_TRIG before insert on GROUPS for each row begin select GBO_attr_SEQ.nextval into :new.GES_NUMBER from dual; end;;
    the last ; is not waited by the compiler.
    One way of coping is to copy the code in SQL worsheet and to manually correct and execute again. But it slows down the design process.

    I just had this error:
    DROP TABLE USERS CASCADE CONSTRAINTS;
    drop sequence GBO_attr_SEQ;
    create sequence GBO_attr_SEQ start with 1;
    create table USERS ( GES_NUMBER NUMBER,NAME VARCHAR2(255) CONSTRAINT USERSGBO_NAME_CHECK NOT NULL,CREATOR VARCHAR2(255) CONSTRAINT USERSGBO_CREATOR_CHECK NOT NULL,OWNER VARCHAR2(255) CONSTRAINT USERSGBO_OWNER_CHECK NOT NULL,CREATION_DATE DATE CONSTRAINT USERSGBO_CREATION_DATE_CHECK NOT NULL,UPDATE_DATE DATE,UPDATE_BY VARCHAR2(255),FAMILY_NAME VARCHAR2(255) CONSTRAINT USERS_FAMILY_NAME_CHECK NOT NULL,FIRST_NAME VARCHAR2(255),COMPANY_EMAIL VARCHAR2(255),PICTURE ORDSYS.ORDIMAGE,DESKTOP_WALL_PAPER ORDSYS.ORDIMAGE,LOCATION VARCHAR2(255),OFFICE_LOCALISATION VARCHAR2(255),ACTIVE NUMBER CONSTRAINT USERS_ACTIVE_CHECK NOT NULL,PHONE_NUMBER VARCHAR2(255),PERSONNAL_PHONE_NUMBER VARCHAR2(255),COMPANY_CELL_PHONE VARCHAR2(255),PERSONNAL_CELL_PHONE VARCHAR2(255),PERSONNAL_EMAIL VARCHAR2(255),ATTR VARCHAR2(255),CURRENT_DEFAULT_DESKTOP_DIRECT VARCHAR2(255),DEFAULT_SERVER_DIRECTORY VARCHAR2(255),CURRENT_DEFAULT_SERVER_DIRECTO VARCHAR2(255),GBO_GES_NUMBER NUMBER CONSTRAINT SYS_C0015300 NOT NULL,ROLE NUMBER,COMPANY VARCHAR2(255),COMPANY_RESORT VARCHAR2(255));
    ALTER TABLE USERS ADD ( CONSTRAINT USERSGBO_PRIMARY_KEY PRIMARY KEY (GES_NUMBER));
    ALTER TABLE USERS ADD ( CONSTRAINT USERSGBO_UNIQUE_KEY UNIQUE (NAME));
    create trigger USERS_INS_TRIG before insert on USERS for each row begin select GBO_attr_SEQ.nextval into :new.GES_NUMBER from dual; end;;
    ALTER TABLE USERS ADD ( CONSTRAINT FK_USERS FOREIGN KEY (GBO_GES_NUMBER) REFERENCES GROUPS(GES_NUMBER));
    ALTER TABLE USERS ADD ( CONSTRAINT FK_USERS1 FOREIGN KEY (GBO_GES_NUMBER) REFERENCES COMPANIES(GES_NUMBER));
    ALTER TABLE USERS ADD ( CONSTRAINT FK_USERS12 FOREIGN KEY (GBO_GES_NUMBER) REFERENCES ENTITY_OBJECT1(null));
    ALTER TABLE USERS ADD ( CONSTRAINT FK_USERS13 FOREIGN KEY (GBO_GES_NUMBER) REFERENCES LOCATIONS(null));
    LINE/COL ERROR
    1/71 PLS-00103: Symbole ";" rencontré
    It looks like the code can't be used like that without two ;. If you remove one you get some answer like that
    Erreurs pour TRIGGER USERS_INS_TRIG :
    LINE/COL ERROR
    3/1 PLS-00103: Symbole "ALTER" rencontré
    The solution is to isolate the line, erase the second semi-colon and add an "or replace" at the beginning.
    It works but it's a bit heavy.

  • Bad bind variable error on creating trigger

    hi
    im trying to create a trigger on a table in Oracle and I keep gettin this error:
    PLS-00049: bad bind variable 'NEW.ID'
    TeamID is a primary Key, it creates the sequence fine, but i get the error on the create trigger,
    CREATE TABLE TBLTEAMS
    TEAMID NUMBER(5),
    NAME VARCHAR2(50 BYTE),
    MANAGER VARCHAR2(50 BYTE),
    COSTCENTRE NUMBER(9),
    PARENTTEAMID NUMBER(5)
    create sequence seq_Teamsautonumber;
    create trigger trg_Teamsautonumber
    before insert on tblteams
    for each row
    begin
    select seq_Teamsautonumber.nextval into :new.id from dual;
    end;
    any ideas?

    You have said
    :new.idthat means you are trying to load the sequence value into a column that doesn't exist in your table.
    you would need to use
    :new.teamidAssuming you are trying to auto-populate the TEAMID column on your table.

  • Error on the trigger creat

    create or replace
    TRIGGER wcowner.t_ins_wc_prd_mdl
    AFTER INSERT on vinapp.model
    FOR EACH ROW
    DECLARE
    v_model vinapp.model.model%type;
    v_make vinapp.make.make%type;
    v_category vinapp.category.category%type;
    v_subcategory vinapp.sub_category.sub_category%type;
    v_family vinapp.product_family.product_family%type;
    v_is_serviceable vinapp.model.attachment%type;
    v_is_regn_reqd vinapp.model.registration_required%type;
    v_is_serialized vinapp.model.serialized%type;
    v_is_active vinapp.model.active%type;
    v_eff_bgn_dt date;
    v_eff_end_dt date;
    v_agc vinapp.model.agc%type;
    BEGIN
    select a.model
    , e.make
    , c.category
    , d.sub_category
    , f.PRODUCT_FAMILY
    , a.attachment
    , a.registration_required
    , a.serialized
    , a.active
    , a.begin_date
    , a.end_date
    , a.agc
    INTO v_model
    , v_make
    , v_category
    , v_subcategory
    , v_family
    , v_is_serviceable
    , v_is_regn_reqd
    , v_is_serialized
    , v_is_active
    , v_eff_bgn_dt
    , v_eff_end_dt
    , v_agc
    from vinapp.model a, vinapp.group_code b, vinapp.category c, vinapp.sub_category d, vinapp.make e, vinapp.product_family f
    where a.model_id = new.model_id
    and a.group_code_id = b.group_code_id
    and b.category_id = c.category_id
    and b.sub_category_id = d.sub_category_id
    and b.make_id = e.make_id
    and a.family_id = f.PRODUCT_FAMILY_ID;
    wcowner.STP_INS_PRD_MDL_0010 (v_model
    , v_make
    , v_category
    , v_subcategory
    , v_family
    , v_is_serviceable
    , v_is_regn_reqd
    , v_is_serialized
    , v_is_active
    , v_eff_bgn_dt
    , v_eff_end_dt
    , v_agc);
    END;
    but got error:
    Error(48,24): PL/SQL: ORA-00904: "NEW"."MODEL_ID": invalid identifier
    any sense

    Hi,
    It might be easier for us to spot if you could deliver your post as formatted SQL*Plus. Like this
    SQL> CREATE OR REPLACE TRIGGER wcowner.t_ins_wc_prd_m
      2     AFTER INSERT
      3     ON vinapp.model
      4     FOR EACH ROW
      5  DECLARE
      6     v_model            vinapp.model.model%TYPE;
      7     v_make             vinapp.make.make%TYPE;
      8     v_category         vinapp.CATEGORY.CATEGORY%TYPE;
      9     v_subcategory      vinapp.sub_category.sub_category%TYPE;
    10     v_family           vinapp.product_family.product_family%TYPE;
    11     v_is_serviceable   vinapp.model.attachment%TYPE;
    12     v_is_regn_reqd     vinapp.model.registration_required%TYPE;
    13     v_is_serialized    vinapp.model.serialized%TYPE;
    14     v_is_active        vinapp.model.active%TYPE;
    15     v_eff_bgn_dt       DATE;
    16     v_eff_end_dt       DATE;
    17     v_agc              vinapp.model.agc%TYPE;
    18  BEGIN
    19     SELECT a.model
    20           ,e.make
    21           ,c.CATEGORY
    22           ,d.sub_category
    23           ,f.product_family
    24           ,a.attachment
    25           ,a.registration_required
    26           ,a.serialized
    27           ,a.active
    28           ,a.begin_date
    29           ,a.end_date
    30           ,a.agc
    31       INTO v_model
    32           ,v_make
    33           ,v_category
    34           ,v_subcategory
    35           ,v_family
    36           ,v_is_serviceable
    37           ,v_is_regn_reqd
    38           ,v_is_serialized
    39           ,v_is_active
    40           ,v_eff_bgn_dt
    41           ,v_eff_end_dt
    42           ,v_agc
    43       FROM vinapp.model a
    44           ,vinapp.group_code b
    45           ,vinapp.CATEGORY c
    46           ,vinapp.sub_category d
    47           ,vinapp.make e
    48           ,vinapp.product_family f
    49      WHERE a.model_id = :new.model_id
    50        AND a.group_code_id = b.group_code_id
    51        AND b.category_id = c.category_id
    52        AND b.sub_category_id = d.sub_category_id
    53        AND b.make_id = e.make_id
    54        AND a.family_id = f.product_family_id;
    55
    56     wcowner.stp_ins_prd_mdl_0010(v_model
    57                                 ,v_make
    58                                 ,v_category
    59                                 ,v_subcategory
    60                                 ,v_family
    61                                 ,v_is_serviceable
    62                                 ,v_is_regn_reqd
    63                                 ,v_is_serialized
    64                                 ,v_is_active
    65                                 ,v_eff_bgn_dt
    66                                 ,v_eff_end_dt
    67                                 ,v_agc);
    68  END;
    69  /
       ON vinapp.model
    FEJL i linie 3:
    ORA-00942: table or view does not existRegards
    Peter

  • Error while using trigger and sequences

    hi friends
    i am leraning oracle now. i have confronted a difficulty while working with triggers and sequence . iF anybody knows this problem ,please help me
    i created atable with the specifications given below
    CREATE TABLE TESTSEQ
    idno NUMERIC(10),
    data1 VARCHAR2(50)
    and i created a sequence named seqcol1
    CREATE SEQUENCE seqcol1
    MINVALUE 1
    MAXVALUE 100
    START WITH 1
    INCREMENT BY 1
    CACHE 20;
    I created a trigger also named
    CREATE OR REPLACE TRIGGER trigADD2
    BEFORE
    INSERT ON TESTSEQ
    FOR EACH ROW
    BEGIN
    SELECT seqcol.NEXTVAL INTO idno;
    END;
    My plan is to add the idno automatically from sequence while inserting a value in data1 column
    while doing insert operation ,
    INSERT INTO TESTSEQ (data1) VALUES ('ram1')
    some error is showing
    the error is SCOTT.trigADD2 is invalid and failed re-validation
    if anybody can help me please help me
    thanks and regards

    ops$oskar@test9i$ create table t (n number, s varchar2(1));
    Table created.
    ops$oskar@test9i$ create sequence s;
    Sequence created.
    ops$oskar@test9i$ insert into t values (s.nextval,'X');
    1 row created.
    ops$oskar@test9i$ insert into t values (s.nextval,'Y');
    1 row created.
    ops$oskar@test9i$ insert into t values (s.nextval,'Z');
    1 row created.
    ops$oskar@test9i$ select * from t;
             N S
             1 X
             2 Y
             3 ZWhat do you need a trigger for?

  • Query running OK in SQL, giving error in form trigger.

    Hi guys,
    i am in a strange situation. I have a table.
    EMP_SCALES with fields and datatype.
    PAY_SCALE BASIC_SAL
    VI 8000
    VI-1 10000
    Now when on SQL PROMPT i try to find out BASIC_SAL in the table EMP_SCALES i am writing this query and its working.
    SQL>select basic_sal from emp_scales where pay_scale like('%VI-1%');
    Now i have to use the same query in when-button-press event of a button in my form.
    Code:
    DECLARE
    basic_sal_emp number;
    curr_emp_scale := :BLOCK.MYFIELD;
    BEGIN
    SELECT BASIC_SAL
    INTO BASIC_SAL_EMP
    FROM EMP_SCALES
    WHERE PAY_SCALE LIKE ('%curr_emp_scale%');          
    END;
    (Where :BLOCK.MYFIELD consist EMP_SCALE and its datatype is also char)
    this query retrieves no record... and gives error.
    ORA-01403 which says..
    Cause: In a host language program, all records have been fetched. The return code from the fetch was +4, indicating that all records have been returned from the SQL query.
    Action: Terminate processing for the SELECT statement
    HOW CAN I RESOLVE MY PROBLEM?????
    Plis help
    Imran Baig

    Dur. Everyone seems to have overlooked the import of the error message: ORA-01422. This is thrown whenever an exact fetch returns more than one row.
    The code works when the value 'VI-1' is hard-coded because there's only one row like that. However, when a field is used the query is obviously returning more than one row. For instance, if :EMP_INCREMENTS.CUR_SCALE is empty (NULL) then the query will return all rows (which is more than one). The same applies if the field has a value of 'VI'.
    If you want to use INTO then the query must either return exactly one row or else the trigger needs to handle multiple returns.
    Cheets, APC

  • Error in compiling trigger

    Hi,
    I'm compiling a trigger ORG_LOAN_DATE_BUI_TRG which is having length as 21 chars, but getting the error
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 16
    but if I reduce the name to 20 chars then its not giving any error, while there are other triggers also in the same schema which are having name > 20 chars but are valid
    Pls advise for this strange behaviour\
    Thanks
    Deepak

    below is the code. However that is not the problem as if I keep only 5-6 lines in trigger then also it is giving error at line no. 16
    CREATE OR REPLACE TRIGGER "WBC_GOE_04".ORG_LOAN_DATE_BUI_TRG BEFORE UPDATE OR INSERT ON  ORG_LOAN
    FOR EACH ROW
    BEGIN
          :NEW.closfees_paid_date     := TRUNC(:NEW.closfees_paid_date);
          :NEW.closing_date     := TRUNC(:NEW.closing_date);
          :NEW.conv_first_date     := TRUNC(:NEW.conv_first_date);
          :NEW.est_closing_date     := TRUNC(:NEW.est_closing_date);
          :NEW.product_expiration     := TRUNC(:NEW.product_expiration);
          IF (:NEW.DSH_SUBSIDISED IS NULL) Then
               :NEW.DSH_SUBSIDISED := 'N';
          END IF;
    END;
    /Thanks
    Deepak

  • What is the error in this trigger

    create or replace trigger tt1
    after insert on EXERCISE2_T
    referencing new as new
    for each row
    declare
    v_excd EXERCISE2_T.EX_CD%type:=(CASE EX_CD
        WHEN 'X' THEN 'Extracted';
        WHEN 'F' THEN 'Failed';
        WHEN 'S' THEN 'Skipped';
        WHEN 'C' THEN 'Cancelled';
        ELSE 'no');
    begin
    insert into DWH_DEX2_RD_T(DK_EX2,
    EX2_CD,
    EX2_NM) values(:new.EX_ID,:new.EX_CD,v_excd);
    end;error
    3/30 PLS-00103: Encountered the symbol ";" when expecting one of the following:
    * & = - + < / > at else end in is mod remainder not rem when
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || multiset member SUBMULTISET_

    create or replace trigger tt1
      after insert
      on exercise2_t
      referencing new as new
      for each row
    declare
      v_excd                        exercise2_t.ex_cd%type
        := case ex_cd
        when 'X'
          then 'Extracted'
        when 'F'
          then 'Failed'
        when 'S'
          then 'Skipped'
        when 'C'
          then 'Cancelled'
        else 'no'
      end;
    begin
      insert into dwh_dex2_rd_t
                    dk_ex2, ex2_cd, ex2_nm )
           values (
                    :new.ex_id, :new.ex_cd, v_excd );
    end;
    /In other words: the semi-columns and the case-END.

Maybe you are looking for