AfterReport Trigger not working

Hi. My XML contains before and after report trigger. My beforeReport trigger works well but my afterReport trigger got problem. My afterReport trigger triggered before my dataStructure.
Below is my XMl sample.
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Header: Vacancy Raised with Status Summary Report.xml 2010/11/12 Gunasilan Muniandy $-->
<dataTemplate name="Recruitment_Key_Performance_Indicators_Report" defaultPackage="MASIRC_KPI_REPORT_PKG" version="1.0">     
     <properties>
          <property name="xml_tag_case" value="upper"/>
          <property name="debug_mode" value="on"/>
     </properties>
          <parameters>
          <parameter name="P_Vacancy_From" dataType="character" />     
          <parameter name="P_Vacancy_To" dataType="character" />     
          <parameter name="P_Report_Time" dataType="character" />     
</parameters>
     <dataTrigger name ="beforeReport" source="MASIRC_KPI_REPORT_PKG.CallProcedure(:P_Vacancy_From,:P_Vacancy_To,:P_Report_Time)"/>
     <dataQuery>          
          <sqlStatement name="details">
               <![CDATA[
                SELECT
                NO,
                VAC_NAME,
                RAS_APPROVE,
                PUB_ST_DATE,
                PUB_EN_DATE,
                SHORLISTING,
                INTERVIEW,
                OFFER_ST_DT,
                OFFER_EN_DT,
                REPORT_DT
               FROM MAS_IRC_KPI_TBL
               where Report_dt =:P_Report_Time
               ORDER BY VAC_NAME,no               
                 ]]>
          </sqlStatement>          
     </dataQuery>     
          <dataStructure>
               <group name="G_1" dataType="varchar2" source="details">
               <element name="VAC_NAME"      dataType="varchar2"      value="VAC_NAME" />          
               <element name="RAS_APPROVE" dataType="varchar2"      value="RAS_APPROVE" />     
               <element name="PUB_ST_DATE" dataType="varchar2"      value="PUB_ST_DATE" />          
               <element name="PUB_EN_DATE" dataType="varchar2"      value="PUB_EN_DATE"      />     
               <element name="SHORLISTING"      dataType="varchar2"      value="SHORLISTING"      />          
               <element name="INTERVIEW"      dataType="varchar2"      value="INTERVIEW" />          
               <element name="OFFER_ST_DT"      dataType="varchar2"      value="OFFER_ST_DT" />     
               <element name="OFFER_EN_DT"      dataType="varchar2"      value="OFFER_EN_DT" />
               </group>               
          </dataStructure>
          <dataTrigger name ="afterReport" source="MASIRC_KPI_REPORT_PKG.CallProcedureDelete(:P_Report_Time)"/>
</dataTemplate>
please advice. thanks.

try with naming the procedure afterreport......

Similar Messages

  • Format Trigger not working in 10g Report.

    I have a report with two eclipses
    (*) Debit (*) Credit . Please note that the two asterics denotes eclipses.
    I have a format triggers on these eclipses based on the database item Debit_credit.
    IF :debit_credit = 'CREDIT' THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    End if;
    and vis-visa. However the format trigger is not working. Regardless of the value of
    debit_credit. I even created a frame around these eclipses and put my format trigger all to no avail. Please help.

    Create a boilerplate text in your repeating frame (get rid of the field :debit_credit from your layout, but leave it in your query). I created the boilerplate field B_1. My format trigger looks like:
    function B_1FormatTrigger return boolean is
    begin
      if upper(:debit_credit) = 'CREDIT' then
           srw.set_field(0, to_char('(*) CREDIT'));
       else srw.set_field(0, to_char('(*) DEBIT'));
      end if;
      return (TRUE);
    end;I hope I understood your question OK...I am not sure what an eclipses is?

  • After Logon on Database Trigger Not Working From Client Terminal

    Hi Every One
    I Have a Problem, I'am Using Oracle 10g R2, I'd Written After Logon on Database Trigger, I'd Written The Trigger Under The Under The User With DBA Privileges, and it is work Fine, but it is work only when i Logon On The Database from The Server Terminal with any user, and If Logon From any Other Terminal It Is Not Work,
    Can any One Know The Reason, Please Help me
    Yasser Mokhtar

    Please post the trigger code.

  • Business Rule in trigger not working

    Hi,
    I have business rule that no one below 18 years should be employed in this system.
    I have created a trigger that alerts me so, but when ever I insert someone either over 10 or below, it fires and deos not insert any record, but if I deleted the trigger, everything works fine.
    I should have put a check constraint (s_hire_date - s_dob) < 6570 on the table, but I just thought should be able to do it.
    Why please?
    stops insertion of under 18 years into employee table
    CREATE OR REPLACE TRIGGER Tr_new_employee
    BEFORE INSERT ON employee for each row
    DECLARE s_hire_date DATE;
    s_dob date;
    begin
    select :NEW.hire_date, :NEW.dob into s_hire_date, s_dob from employee
    where empid =:new.empid;
    IF (s_hire_date - s_dob) < 6570 then
    raise_application_error(-20101,'Person too young');
    end if;
    end;
    Many thanks in advance
    cube60

    Hello Warren and All,
    Thanks for the code, the trigger did compile successfully, but prevents any kind of insertion whether over 18 or younger.
    SQL> CREATE OR REPLACE TRIGGER Tr_new_employee
    2 BEFORE INSERT ON employee for each row
    3 DECLARE s_hire_date DATE;
    4 s_dob date;
    5 begin
    6
    7 select :NEW.hire_date, :NEW.dob into s_hire_date, s_dob from employee
    8 where empid =:new.empid;
    9
    10 IF TRUNC(months_between(s_hire_date,s_dob)/12) < 18 then
    11 raise_application_error(-20101,'Person too young');
    12 end if;
    13 end;
    14 /
    Trigger created.
    SQL> COMMIT;
    Commit complete.
    SQL> --under 18 to time of hire_date
    SQL> EXEC NEW_EMPLOYEE('CHARLES','DICKSON','M','29-JAN-1992','PT2','','','','',sysdate,NULL,09890111
    ,'HSBC','WANDSWORTH','CURRENT','PR3');
    BEGIN NEW_EMPLOYEE('CHARLES','DICKSON','M','29-JAN-1992','PT2','','','','',sysdate,NULL,09890111,'HS
    ERROR at line 1:
    ORA-01403: no data found
    ORA-01403: no data found
    ORA-06512: at "SYSTEM.TR_NEW_EMPLOYEE", line 5
    ORA-04088: error during execution of trigger 'SYSTEM.TR_NEW_EMPLOYEE'
    ORA-06512: at "SYSTEM.NEW_EMPLOYEE", line 26
    ORA-06512: at line 1
    SQL> COMMIT;
    Commit complete.
    SQL> --over 18
    SQL> EXEC NEW_EMPLOYEE('WARREN','TALENTINO','M','29-JAN-1975','HOURLY','','','','','18-FEB-2001',NUL
    L,36901212,'BARCLAYS','SYDENHAM','CURRENT','TEMP7');
    BEGIN NEW_EMPLOYEE('WARREN','TALENTINO','M','29-JAN-1975','HOURLY','','','','','18-FEB-2001',NULL,36
    ERROR at line 1:
    ORA-01403: no data found
    ORA-01403: no data found
    ORA-06512: at "SYSTEM.TR_NEW_EMPLOYEE", line 5
    ORA-04088: error during execution of trigger 'SYSTEM.TR_NEW_EMPLOYEE'
    ORA-06512: at "SYSTEM.NEW_EMPLOYEE", line 26
    ORA-06512: at line 1
    I know your logic is fine, something might be wrong with the trigger even though it created succesfully. It is not doing what it is intended to do.
    Many thanks
    cube60

  • Account Assignment Trigger not Working

    I'm working on Siebel Assignment Manager.. first I try to Assign Service Request to an Employee and in two Assignment mode (Batch and Dynamic) and it's work fine.
    but when I try to assign Account to a Position, and I follow the same steps I followed before, the monitor work and the owner change depending on the Score and the Rule not working ...on the other hand the trigger (Dynamic) not working at all, and there is no change
    I have searched to know where is the problem …and didn’t find solution
    please help me ASAP
    Thanks & Regards,
    Enas

    Hi Glenn,
    Thanks for u r replay.
    We are using our own ZVIEWS. We have copied the Bupasearch view and we done some modifications according to our requirement.(added DOB field)
    We got DOB in our Zview. But Customer search functionality is not working.
    Plz help me to solve the issue.
    Thanks,
    Sreedhar

  • Oracle Form Services Installation (Test.fmx) Trigger Not working

    Hi
    I install oracle BI and forms Services on oracle application infrastructure after installation i run the following command "http://ora.server.com:7778/forms/frmservlet?config=testfrm" it will show the form "form services install sucessfully" but when i do a certain cusmization on it i.e. put a one text box on that text put put a key_next tigger in which i show a alert message only. After Customization i run a same URL it will again show that form with the changes but the trigger (Key_next) will not fire
    I don't understatnd why tigger is not working or fire.

    So we understand things correctly,
    You are running a form and a trigger won't fire. What kind of trigger? A when-button-pressed, or a key-next-item, or something else? I don't believe key_next is a valid trigger.
    If you are using a key trigger, you need to make sure that the keys are mapped as you expect. You can see how the keys are mapped in the menu under Help => Keys when you run the form. Make sure the button is mapped like you expect. Additionally, you can modify the mapping by updating the resource file, but that's kind of outside the scope of this...
    This type of questions really is suited for the Forms forum under Developer Tools => Forms at: Forms
    If you need more help, post there. The focus of that section if Forms.

  • Trigger not working as expected

    create or replace trigger EMP_B4
      before insert on SCOTT.EMP 
      for each row
      when (NEW.SAL IS NULL)
    declare
      -- local variables here
      i NUMBER;
    begin
      :NEW.SAL := 22222;
    end EMP_B4;Hi,
    The trigger is not working; when an entry inserted with SAL null, I should see the salary set to default 22222. But sometimes, it dont work and SAL remains as NULL.
    Anyone encountered similar case before?
    Message was edited by:
    [email protected]

    Hi,
    Here is what i have done. I have used your trigger as;
    SQL> create or replace trigger EMP_B4
    2 before insert on SCOTT.EMP
    3 for each row
    4 when (NEW.SAL IS NULL)
    5 declare
    6 -- local variables here
    7 i NUMBER;
    8 begin
    9 :NEW.SAL := 22222;
    10* end EMP_B4;
    11 /
    Trigger created.
    SQL> insert into emp (empno,deptno) values (111,10);
    1 row created.
    SQL> select * from emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    111 22222 10
    211 yogesh analyst 7369 12-DEC-05 22222 10 20
    SQL> insert into emp values (211,'yogesh','analyst',7369,'12-dec-2005','',10,20);
    1 row created.
    SQL> select * from emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    111 22222 10
    211 yogesh analyst 7369 12-DEC-05 22222 10 20
    See, again it's working fine. Can you give a case where your trigger has not workrd properly.

  • Logon trigger not working over DB-Link?

    Hi all,
    I have a serious question about accessing tables over a database link.
    I have three schema:
    DATA@SOURCE
    INTERFACE@SOURCE
    WORK@TARGET
    Schema DATA has one table called T1
    The INTERFACE schema has select privileges on all tables from DATA. Furthermore schema INTERFACE has a logon trigger to change the "current schema" to DATA:
    CREATE OR REPLACE TRIGGER TRG_A_LOGIN_SET_SCHEMA AFTER LOGON
    ON INTERFACE.SCHEMA
    BEGIN
    execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = DATA';
    END;
    The WORK schema has a database link to the INTERFACE schema called INT_DB_LINK.
    I am now logged into schema WORK on the TARGET database and I am executing following statement:
    select a from T1@INT_DB_LINK
    -> it's working
    Next I execute
    declare
      cursor c is 
      select a
        from T1@INT_DB_LINK
       where rownum<2;
    begin
      for r in c loop
        null;
      end loop;
    end;
    This is not working. Error message is ORA-000942: table or view does not exist.
    But why?
    Can anyone help me?
    Thanks in advance
    Py

    Hi all,
    after a long, very long search I found what caused this strange behaviour.
    The ORA- Error was not raised by the SQL-Execution-Engine but by the SQL-Parser/SQL-Validation.
    As the second statement is an anonymous SQL block the Oracle Parser checks all objects dependencies before execution.
    This means a connection is established from TARGET to SOURCE checking if table T1 is available. The strange thing is
    that on this connection the "ALTER SESSION" trigger is not fired. So the parser does not find object T1 in schema INTERFACE.
    If I create an empty table T1 in INTERFACE the anonymous block gets parsed/validated and the statement is executed. But this
    time the block does a normal "connect session" and the trigger is fired. This means the statements accesses the T1 table in
    schema DATA. (But T1 in INTERFACE has to be existent that parse/validation works)
    I don't know if this is a bug or a feature.
    To workaround this I have created private synonyms in schema INTERFACE pointing to the objects in DATA.
    Thanks for your help!
    Py
    regarding the other qestion:
    Yes, permissions are granted over a role.

  • Trigger not working correctly

    Hello all.
    I am working on a project, Yes it is for a class. I am creating a simple Boat rental db. I am trying to construct a Trigger that will verify when a Reservation is made for a particular date and time in the future (current day and beyond) that the Rental_Start_Time falls within the business hours for that particular date.
    I have a Reservation table
    CREATE TABLE RESERVATION
      (res_id NUMBER (10),
      req_date  DATE,
      renter_id NUMBER(10),
      model VARCHAR2(30) NOT NULL,
      rental_date DATE NOT NULL,
      rental_start_time DATE NOT NULL,
      rental_end_time DATE NOT NULL,
      guests NUMBER(2) NOT NULL,
      CONSTRAINT res_id_pk
      PRIMARY KEY(res_id, req_date, renter_id, model))My trigger is as such:
    CREATE OR REPLACE TRIGGER bus_hrs
    BEFORE INSERT ON RESERVATION
    FOR EACH ROW
    DECLARE
    RST DATE :=  :NEW.RENTAL_START_TIME;
    RD DATE := :NEW.RENTAL_DATE;
    BEGIN
    IF ((TO_CHAR(RD,'D') BETWEEN 1 AND 5) AND
    (TO_DATE(TO_CHAR(RST, 'hh24:mi'), 'hh24:mi') NOT BETWEEN
    TO_DATE('12:00', 'hh24:mi') AND TO_DATE('21:00', 'hh24:mi')))
    OR ((TO_CHAR(RD, 'D') BETWEEN 6 AND 7)
    AND (TO_DATE(TO_CHAR(RST, 'hh24:mi'), 'hh24:mi') NOT BETWEEN
    TO_DATE('08:00', 'hh24:mi') AND TO_DATE('24:00', 'hh24:mi'))) THEN
    RAISE_APPLICATION_ERROR(-20999,
    'Rental start times cannot be scheduled outside of business hours');
    END IF;
    END bus_hrs;And this is my call:
    CALL make_reservation(SYSDATE,'11','pontoon' , (to_date('2012/06/15 08:00', 'yyyy/mm/dd hh24:mi')),(to_date('2012/06/15 08:00', 'yyyy/mm/dd hh24:mi')), (to_date('2012/06/15 16:00', 'yyyy/mm/dd hh24:mi')), '12');And this is the result I am seeing:
    ORA-20999: Unhandled error in make_reservation. Please contact your application administrator with the following information: ORA-01850: hour must be between 0 and 23 ORA-06512: at "LAKERS.BUS_HRS", line 9 ORA-04088: error during execution of trigger 'LAKERS.BUS_HRS' ORA-06512: at "LAKERS.EXCEPTION_HANDLER", line 11 ORA-06512: at "LAKERS.MAKE_RESERVATION", line 15
    In the Call I am trying to make enter a reservation for June 15 with a start time of 08:00 AM which should be an hour of 8, however the error response tells me it is not recognizing the hour.
    Am I formating the Call wrong or do i have a problem within the trigger?
    Thanks for taking the time to look.
    G

    Hi,
    You're doing a lot of converting between DATEs and VARCHAR2s, and back again. There's no need for that.
    It looks like all you need to know about :NEW.rental_start_time is the time of day. If so, convert it once for all into a form convenient to work with, such as as string like '14:30'. Likewise for :NEW.rental_date.
    I think you want something like this:
    CREATE OR REPLACE TRIGGER bus_hrs
    BEFORE INSERT ON RESERVATION
    FOR EACH ROW
    DECLARE
        days_into_week     NUMBER          := :NEW.rental_date
                              - TRUNC (:NEW.rental_date, 'IW');
        rst               VARCHAR2 (5)     := TO_CHAR ( :NEW.rental_start_time
                                        , 'HH24:MI'
    BEGIN
        IF  (days_into_week <  5  AND  rst NOT BETWEEN '08:00' AND '24:00')     -- Monday-Friday
        OR  (days_into_week >= 5  AND  rst NOT BETWEEN '12:00' AND '21:00')     -- Saturday-Sunday
        THEN
            RAISE_APPLICATION_ERROR ( -20999
                        , 'Rental start times cannot be scheduled outside of business hours'
        END IF;
    END bus_hrs;
    SHOW ERRORSDo you really need two separate columns, rental_date and rental_start_time? What are you using the hours, minutes and seconds parts of rental_date for? What are you using the year, month and day parts of rental_start_date for?
    TO_CHAR (date_column, 'D') depends on your NLS_TERRITORY setting. If you ever change NLS_TERRITORY, you're probably not going to remember to change this trigger. I used 'IW' instead of 'D', because 'IW' does not depend on any NLS settings.

  • Report format trigger not working

    Hi,
    I am using a format trigger on a column in my report as follows:
    function B_9FormatTrigger return boolean is
    begin
    if (:TEST > 30) then
    return (FALSE);
    else
    return (TRUE);
    end if;
    end;
    When testing in reports builder everything works fine, but when running the report from a form, the trigger is not executed.
    I am thinking this might have something to do with te reports runtime, but i don't know how to solve it.
    I am using Report Builder 9.0.4.0.33
    Edited by: user10085365 on 3-feb-2009 6:12

    so, did you try my suggestion to switch the condition?
    Or, is there maybe an old rep-file in your runtime-environment which doesn't include the format-trigger? Try to colorize a field and see if the correct reports-version is run.
    And I am a 100% shure the :TEST value is correct.
    So the field that should be hidden, stays displayedYes, but its unlikely that you hit a bug here (but not impossible), the chance in gendral is higher that there is some other reason for that. (in my case, 99.99% of the things which don't work are my own fault ;-) )

  • DATABASE Trigger not Working

    Dear All,
    I wrote the DataBase Trigger which gets compile but not execute and if i execute the procedure manually then it works.
    CREATE OR REPLACE TRIGGER ficreports.trg_omni
    AFTER STARTUP ON DATABASE
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    Temp_Reporting_Datasync;
    commit;
    END;
    Kindly give your valuable suggestions to start executing the trigger after starting the database.
    Regards,
    Anand

    Yes , if it is fired then it will perform the DML operation on the tables which is mentioned inside the procedure..
    Is there any possiblibility of not firing the trigger or the way of calling procedure is not correct ?
    Kindly confirm.

  • Echo letter /proc/sysrq-trigger not-working? [Solved]

    According to various resources including https://fedoraproject.org/wiki/QA/Sysrq … it_work.3F
    It's possible to write a letter to trigger a sysrq command like so:
    [root@a-pc proc]# echo t> /proc/sysrq-trigger
    'm' - Will dump current memory info to your console.
    Edit: apparently the info is outdated? At any-rate it writes correctly to journal rather than to console (I did check the journal as well before posting but I had a few processes on watch and forgot to filter those :S).  Feel free to delete this post if it's not contributing anything.
    Last edited by dejy (2015-04-29 17:54:29)

    Thanks for the tip, but I just discovered the issue on my own: I actually forgot to install "xf86-input-synaptics". (Well, it's the newbie corner... )
    I think I installed it the first time I tried to get everything to work, and then forgot about it the second time I installed Arch on my machine... Sorry for all the fuss about nothing, apparently.
    Last edited by Lustique (2013-11-29 20:43:37)

  • Delete trigger not working on delete button

    I have a form (parent) / report (children) combo page with all the default buttons (create, apply changes, delete, cancel) created from the wizard. I've created a before delete trigger on the parent table that basically finds all the children and deletes them. For debugging purposes, I've added some inserts into a test table to make sure my bind variables binding correctly (they are). When I confirm the java script delete and say ok, the insertion of the text for debugging purposes works fine, but the actual deletion of the other records does not. Any ideas why?

    Then it is easy-your delete process is not fireing!!
    Why...there may be many reasons....but I'm pretty sure that process is never fired!
    Look in your page or show us a demo on workspace

  • Instead of Trigger not working as expected

    We use a view v_test ( union on two tables ) with an Instead of Trigger for insert. The Instead of Trigger just inserts data into one of the underlying tables.
    If we insert a single row ( insert into v_test(...) values(...) ) everything works fine.
    If we insert multiple rows using one statement ( insert into v_test(...) select ...) some columns have same values although they should be different.
    (tested on Oracle 9 and 10)

    here is an example (Oracle Version is 9.2.0.6.0):
    view vtest_:
    SELECT *
    FROM (SELECT * FROM EM_TRANSPORTMITTEL_B
    UNION
    SELECT * FROM EM_TRANSPORTMITTEL_H)
    WHERE Nvl(To_Date(pa_session.f_getContext('hist_date'), 'dd.mm.yyyy hh24:mi:ss'), SYSDATE) BETWEEN hist_from AND hist_to
    Instead of Trigger:
    CREATE OR REPLACE TRIGGER tib_v_test instead of insert on v_test for each row
    declare
    l_cols EM_TRANSPORTMITTEL_B%rowtype;
    begin
    l_cols.EM_TRANSPORTMITTELID := :new.EM_TRANSPORTMITTELID;
    l_cols.tmtyp := :new.tmtyp;
    insert into EM_TRANSPORTMITTEL_B (em_transportmittelid, tmtyp, ....) values (l_cols.em_transportmittelid, l_cols.tmtyp, ....)
    end tib_v_test;
    Insert Statement
    insert into v_test (em_transportmittelid, tmtyp, ...)
    select em_transportmittelid, 'WAGEN' tmtyp, ...
    from tmp_tmstamm
    order by wagenummer;

  • After Insert Trigger Not Working

    Hi All,
    I am not a guru in writing triggers.
    I am inserting new records in a Table FA_BOOKS by application and this inserts records in FA_ADDITIONS_B. This is a vanilla process.
    i have written a trigger on FA_ADDITIONS_B, and i want to update the cost from the fa_books to fa_additions_b column attribute21
    The trigger i have written is After insert on FA_ADDITIONS_B and i try to select cost from the fa_books for the :new.asset_id.
    SELECT COST
    INTO v_cost
    FROM FA_BOOKS
    WHERE ASSET_ID = :NEW.ASSET_ID;
    this is always returning no_data_found exception and i do not understand how to update the attribute21 in FA_ADDITIONS_B
    Here is a sample of my trigger.
    CREATE OR REPLACE TRIGGER update_attribute21_new_asset_1
    after INSERT ON fa_ADDITIONS_B
    FOR EACH ROW
    DECLARE
    V_COST NUMBER;
    BEGIN
    SELECT COST
    INTO v_cost
    FROM FA_BOOKS
    WHERE ASSET_ID = :NEW.ASSET_ID;
    update fa_ADDITIONS_B
    set attribute21 = v_cost
    where ASSET_ID = :NEW.ASSET_ID;
    END;
    Any help on this will be appreciated.
    TX in advance.
    Regards,

    I still haven't understood the reason why you can't transfer the COST information from FA_BOOKS to FA_ADDITIONS_B in the initial trigger on FA_BOOKS that populates FA_ADDITIONS_B. Or how is the population of FA_ADDITIONS_B accomplished? Is it part of the application code?
    Regarding the NO_DATA_FOUND issue:
    Is it ensured that populating the FA_ADDITIONS_B table is done in the same transaction as the FA_BOOKS inserts or that the FA_BOOKS transaction is committed?
    Why do you need that additional trigger?
    My assumption is that you're in a trigger "chain" - if I get your approach correctly - you're basically attempting to query FA_BOOKS in a trigger on FA_ADDITIONS_B that in turn has been triggered by a trigger on FA_BOOKS which gets us back to the "mutating" trigger issue. You can't read a table that is currently in the process of being modified.
    Or even worse: The (potential) trigger on FA_BOOKS that populates FA_ADDITIONS_B uses "autonomous transaction" and therefore the trigger on FA_ADDITIONS_B can't see the changes of the original transaction.
    As already mentioned: Be very careful with "autonomous transactions" in general. There are only a few cases where these are actually useful (e.g. logging purposes), but Tom Kyte has written numerous articles why triggers and in particular autonomous transactions are mostly evil.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for

  • URGENT.PLEASE HELP!!!Print graphics problem

    Hi, Please help me in this one.I try to print Graphics but I can't. 1) Spooling lasts too long 2) After spooling , printing does not continue 3) An empty page is printed instead 4) Printing process takes about 60 Mbytes of RAM to perform (??!!!) Here

  • Sound Distortion problems w/ lower frequency tones/instuments

    I've been ending up with a lot of distortion in tracks when I bounce them over to Itunes. Primarily w/ lower frequency notes on bass and various pads - it's frustrating to have to adjust all the levels to lose the distortion. I obviously don't want t

  • Changes made to cell reference and cell formula in designer are not reflected in analyser?

    Dear Experts, I have made few changes to Bex Report in Query designer by creating cell reference for a cell and the same cell reference used by the formula created on the adjacent cell. I changes are working for 1 Report where as , the exact chanegs

  • Need to setup Oracle 10g Sandbox for Class

    Hello all, This is the first time I am teaching a class on Oracle 10g. I would like some advice on how to do the initial setup of the database. I have 14 students in my class. I want to create each of them an account and I want each of them to be abl

  • Increasing the ring time on 8110 Pearl smartphone

    My phone only rings 3 times before going to voicemail. Other mobile phones I've used had an option to set the time the phone should ring for in seconds (usually up to a maximum of 30 seconds). Does anyone know if this option exists on the 8110 Pearl