Send e-mail sing trigger after insert

Hi,
I need to intiate a trigger in oracle dB after inserting a
record to table I need to send a e-mail to specified person.
This trigger should be cnditional.
eg. Table emp
columns: name dep sal
on insert of every record to this table and when dep code is 3 I
should send e-mail to named person.
Please give me code examples.
thanks

Hi,
Maybe what you are looking for is the db package UTL_SMTP?
If you're using Forms, go to the Navigator, Database Objects,
choose SYS schema and open Stored Program Units. If it's not
there, contact your DBA. I'm not sure if it's available for
databases prior to 8.1.6
Hopefully, the package spec will have some examples that you can
use.
Good Luck,
Pedro
[email protected]

Similar Messages

  • Error while firing a trigger After Insert

    Dear All
    I have created a Table named Punches in user Punch
    and I have written a trigger after Insert on table Punches
    In that Trigger i am wrting some select Command
    and Insert command
    tables are located in Other User
    while firing the trigger it is showing Error.
    pl help

    Arbar Mehaboob - user553581 wrote:
    Dear All
    I have created a Table named Punches in user Punch
    and I have written a trigger after Insert on table Punches
    In that Trigger i am wrting some select Command
    and Insert command
    tables are located in Other User
    while firing the trigger it is showing Error.
    pl helpplease provide:
    1) your database version
    2) the table DDL's
    3) some sample data
    4) the trigger code
    5) the error message you're getting.
    without these, it is impossible to suggest an answer.

  • Print insert result to a printer in TSQL trigger after insert - Need help.

    Hi,
    I am trying to print a record to a printer whenever a new record is inserted into a table called PrintTickets, using TSQL trigger for insert. 
    Is it possible to print a new inserted record to a printer?
    Here is the trigger tsql statement: 
    ALTER TRIGGER [dbo].[PrintDeal]
    ON [dbo].[PrintTickets]
    AFTER INSERT
    AS
    declare @Id numeric(18,0)
    ,@DealId char(15)
    ,@ValueDatePeriod1Currency1 datetime
    ,@Bank1Name char(56)
    ,@Currency1 char(3)
    ,@Currency2 char(3)
    ,@PaymentInstructionP1C1 char(80)
    ,@DealerId char(6)
    ,@DealVolumeCurrency1 float
    ,@CalVolumeP1C2 float
    ,@ExchangeRatePeriod1 float
    declare @tmp table
    Id numeric(18,0)
    ,DealId char(15)
    ,ValueDatePeriod1Currency1 datetime
    ,Bank1Name char(56)
    ,Currency1 char(3)
    ,Currency2 char(3)
    ,PaymentInstructionP1C1 char(80)
    ,DealerId char(6)
    ,DealVolumeCurrency1 float
    ,CalVolumeP1C2 float
    ,ExchangeRatePeriod1 float
    PRIMARY KEY (Id)
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for trigger here
    insert @tmp
    select
    Id
    , DealId
    , ValueDatePeriod1Currency1
    , Bank1Name
    , Currency1
    , Currency2
    , PaymentInstructionP1C1
    , DealerId
    , DealVolumeCurrency1
    , CalVolumeP1C2
    , ExchangeRatePeriod1
    FROM dbo.PrintTickets
    WHERE ID=@@IDENTITY
    select @Id=Id
    ,@DealId=DealId
    ,@ValueDatePeriod1Currency1=ValueDatePeriod1Currency1
    ,@Bank1Name=Bank1Name
    ,@Currency1=Currency1
    ,@Currency2=Currency2
    ,@PaymentInstructionP1C1=PaymentInstructionP1C1
    ,@DealerId=DealerId
    ,@DealVolumeCurrency1=DealVolumeCurrency1
    ,@CalVolumeP1C2=CalVolumeP1C2
    ,@ExchangeRatePeriod1=ExchangeRatePeriod1
    from @tmp
    -- Code to print to a physical printer if possible
    END
    The table is called PrintTickets and it contains the following columns: 
    Id numeric(18,0)
    ,DealId char(15)
    ,ValueDatePeriod1Currency1 datetime
    ,Bank1Name char(56)
    ,Currency1 char(3)
    ,Currency2 char(3)
    ,PaymentInstructionP1C1 char(80)
    ,DealerId char(6)
    ,DealVolumeCurrency1 float
    ,CalVolumeP1C2 float
    ,ExchangeRatePeriod1 float
    PRIMARY KEY (Id)
    The dummy records that I am inserting for testing the results in csv format:
    Id,DealId,ValueDatePeriod1Currency1,Bank1Name,Currency1,Currency2,PaymentInstructionP1C1,DealerId,DealVolumeCurrency1,CalVolumeP1C2,ExchangeRatePeriod1
    696,XXX#33111 ,2014-03-04 00:00:00.000,HSBC ,USD,EUR,XXXXXXXXXXXXXXXXXXXXXXX ,MAT ,342342,87987,0.3123
    697,XXX#33113 ,2014-03-04 00:00:00.000,USB ,EUR,USD,9999999999999999999999,ZXY,2334243,32213,0.3245
    698,XXX#33114 ,2014-03-03 00:00:00.000,SWISS BANK ,CHF,USD,99999999999999900000,XYZ ,32423424,342,0.83432
    699,XXX#33115 ,2014-03-03 00:00:00.000,UK BANK ,USD,PND,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,9809808,0,0.0349
    700,XXX#33116 ,2014-03-04 00:00:00.000,USCF BANK ,XXX,XXX,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,89798797,756756,0.734
    I appreciate any help.
    Thanks in advance.

    Is it possible to print a new inserted record to a printer?
    From SQL Server?
    The task of SQL Server is to manage large of data effciently. It is not a general programming environment. It could possibly be done with a CLR procedure that that talks to the printer, but it is not the correct solution.
    A possible design could be to post a message on a Service Broker queue, and then the printing server would poll the queue and print the ticket.
    By the way, there are more flaws in your trigger. To find the inserted rows, you need to query the virtual table "inserted" which holds a copy of these rows. Furthermore, since a trigger fires once per statement, the trigger must handle the fact
    that multiple rows are inserted.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Error on Trigger After Insert

    I am having two table based on insertion on table one i have created trigger , trigger will insert the data to table two
    i am getting the error when i execute for the second time i.e i have execute one record each successfully in both tables.
    on second time i'm getting this error
    CREATE OR REPLACE TRIGGER Triggername
    AFTER INSERT ON mytable
    DECLARE v_local varchar2(1800);
    BEGIN
    SELECT col1 INTO v_local FROM myschema.mytab;
    insert into mytable (Col1,Col2,Col3)
    with t1 as( select v_local str from dual),
    t2 as( Select startid, endid from SplitLayout),
    t3 as
    ( select str,startid s,endid e, row_number() over(order by startid) rn from t1,t2)
    select * from t3 pivot
    max(substr(str,s,e)) str for rn in (1,2,3);
    End;
    startid,Endid
    1,1
    2,1
    3,1
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "myschema.Triggername", line 4
    ORA-04088: error during execution of trigger 'myschema.Triggername'
    ORA-06512: at "myschema.SPname", line 4
    ORA-06512: at line 1

    Hi,
    eleven less than yesterday. That's good for a start. But keep on tidying up.
    Concerning your trigger-problem, "933663" is very right to say
    >
    you are creating a AFTER INSERT trigger on MYTABLE, which will again insert data into MYTABLE ..!!!!
    >
    I can't either see why this should be sensible. Do you know the concept of :new and :old. Have a look at
    [url http://docs.oracle.com/cd/E11882_01/server.112/e25789/srvrside.htm#CNCPT118]Overview on Triggers. DML-Triggers should interest you most for now.
    As far as I understand your first posting the following passage causes the problems
    >
    SELECT col1 INTO v_local FROM myschema.mytab;to analyze if this statement causes the
    >
    ORA-01422: exact fetch returns more than requested number of rows
    >
    you may execute something like
    select count (*)
    from myschema.mytab
    group by col1
    having count(*) > 1;Good luck
    Bye
    stratmo

  • Custom Trigger After Insert

    After a insert into table 1, i want to take a value from that transaction and use it in a custom trigger to instert into another datbase the 2 values. One is the primary key value of the transaction of table 1 and the other is a session variable of the logged in user. I can get the value of the session user, but i cant get the value of the transaction field.
    $updateRequestDate = "INSERT INTO request_notify (id_request, username) Values({rsrequest.id_request}, '" . $_SESSION['kt_login_user'] . "')";
    $update_result = $tNG->connection->execute($updateRequestDate);
    if(!$update_result) {
    $updateError = new tNG_error("Error setting the logged in status to N", array(), array());
    return $updateError;
    } else {
    return NULL;
    I have the custom trigger set to go after insert transaction.
    How do you get the value of a transaction field for a custom trigger?

    Gunter,
    You rock. Working example, using your knowledge.
    $updateRequestDate = "INSERT INTO test2 (idtest_note, username_note) VALUES ('". $tNG->getColumnValue("id_test") ."', '". $_SESSION['kt_login_user']."')";
    $update_result = $tNG->connection->execute($updateRequestDate);
    if(!$update_result) {
    $updateError = new tNG_error("Error setting the logged in status to N", array(), array());
    return $updateError;
    } else {
    return NULL;

  • LSMW - Sending E-Mail about errors after a batch input has been processed..

    Hi All,
    I have a requirement in LSMW. The LSMW has to send an e-mail to a distribution list after all records are read and posted through LSMW i.e, if the method used is Batch Input Session then an e-mail has to be sent to a distribution list after the Batch Input Session has been processed. Kindly help me regarding this..
    Regards,
    Mahesh

    Hi,
    You can trigger an event once all the records are being processed and use that event to start the workflow. From workflow you can send mails to the initiator of the Batch session.
    Regards,
    Sumalatha

  • BADI for Vendor Invoice after Posting to send a mail to vendor

    Hi,
    My requirement Is like this.
    I have to send a mail to vendor after the Invoice for vendor is Posted.
    For dat I am searching for a badi to implement after the invoice is successfully posted.
    Please give some solution about this.
    Regards,
    Jyoti..

    if it is F-43 . check out the following
    BAdI Definition      Description                                                                               
    AC_QUANTITY_GET      Transfer of Quantities to Accounting - Customer Exit       
    BADI_ENJ_ALT_ADR     Go to alternative vendor/customer data                     
    BADI_F040_SCREEN_600 Screen Enhancement on F040 0600 Document Header            
    BADI_FDCB_SUBBAS01   Screen Enhancement 1 on FDCB Basic Data Screen (010, 510)  
    BADI_FDCB_SUBBAS02   Screen Enhancement 2 on FDCB Basic Data Screen (010, 510)  
    BADI_FDCB_SUBBAS03   Screen Enhancement 3 on FDCB Basic Data Screen (010, 510)  
    BADI_FDCB_SUBBAS04   Screen Enhancement 4 on FDCB Basic Data Screen (010, 510)  
    BADI_FDCB_SUBBAS05   Screen Enhancement 5 on FDCB Basic Data Screen (010, 510)  
    BADI_PRKNG_NO_UPDATE BAdI for Deactivating Update of Parked Documents           
    F050S008             FIDCC1, FIDCC2 Inbound IDoc: Update Comparison Ledger      
    FBAS_CIN_LTAX1F02    Tax interface                                              
    FBAS_CIN_MF05AFA0    EWT - Downpayment Clearing - Tax transfer for CIN          
    FI_AUTHORITY_ITEM    Extended Authorization Check for Document Display (FB03)   
    FI_GET_INV_PYMT_AMT  BAdI for determining the payment amount for an invoice     
    FI_HEADER_SUB_1300   Screen Enhancement for Document Header SAPMF05A            
    FI_PAYREF_BADI_010   BAdI: Payment Reference Number                             
    FI_TRANS_DATE_DERIVE Derive BKPF-WWERT from Other Document Header Data          
    INVOIC_FI_INBOUND    BADIs for Inbound IDoc INVOIC FI (Vendor Invoice)          
    RFESR000_BADI_001    BAdI for Own Processing of POR Item                        
    otherwise - find out the package of the program of the transaction.
    go to se84 - enhancements- business add ins - definitions - enter package and execute - you will see all the definations.

  • After insert trigger error

    Hi,
    i have created an Trigger After Insert According to me, It's correct But it show me Error Can Not Insert Null in to code.
    CREATE OR REPLACE TRIGGER  "AFT_INS_CRM_CUSTOMER_CONTACTS"
      AFTER INSERT ON FH_TAPROD.CRM_SALES_CUSTOMER_CONTACTS
    FOR EACH ROW
    DECLARE
    custo_id NUMBER;
    var_code varchar2(8);
    cont_code varchar2(5);
    BEGIN
    SELECT CUSTOMER_ID INTO custo_id FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =:NEW.ID;
      select CODE into var_code from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=custo_id ;
      SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') into cont_code FROM vendor_customer_contact
      insert into VENDOR_CUSTOMER_CONTACT(SBU_CODE ,CODE,CONTACT_CODE, CONTACT_NAME ,PHONE_NO1 ,MOBILE_NO ,EMAIL, ADDRESS1,CUST_ID,UPLOAD_CRM)
       values('0002',var_code,cont_code,:NEW.CONTACT_NAME,:NEW.CONTACT_PHONE,:NEW.CONTACT_CELL,:NEW.CONTACT_EMAIL,:NEW.CONTACT_ADDRESS,custo_id,'CRM');
    END;
    CREATE TABLE  "CRM_SALES_CUSTOMER_CONTACTS"
       (     "ID" NUMBER,
         "CUSTOMER_ID" NUMBER,
         "CONTACT_NAME" VARCHAR2(255),
         "CONTACT_EMAIL" VARCHAR2(255),
         "CONTACT_PHONE" VARCHAR2(255),
         "CONTACT_CELL" VARCHAR2(255),
         "CONTACT_ADDRESS" VARCHAR2(4000),
          PRIMARY KEY ("ID") ENABLE
    INSERT INTO CRM_SALES_CUSTOMER_CONTACTS VALUES (204414862717175278810736770347803084847, 204232590877603599356756434170666837075, 'SANJAY',    '[email protected]', 1246456, 57152357,'Near Post Office');
    CREATE OR REPLACE TRIGGER  "BIU_CRM_SALES_CUST_CONTACTS"
    BEFORE INSERT OR UPDATE ON CRM_SALES_CUSTOMER_CONTACTS
        FOR EACH ROW
    begin
        if inserting and :new.id is null then
            select to_number(sys_guid(),'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') into :new.id from dual;
        end if;
        if inserting then
            :new.created_by := nvl(v('APP_USER'),USER);
            :new.created_on := sysdate;
        end if;
        if updating then
            :new.updated_by := nvl(v('APP_USER'),USER);
            :new.updated_on := sysdate;
        end if;
    end;My After Insert TAble
    CREATE TABLE  "VENDOR_CUSTOMER_CONTACT"
       (     "SBU_CODE" VARCHAR2(4) NOT NULL ENABLE,
         "CODE" VARCHAR2(8) NOT NULL ENABLE,
         "CONTACT_CODE" VARCHAR2(5) NOT NULL ENABLE,
         "CONTACT_NAME" VARCHAR2(1000) NOT NULL ENABLE,
         "PHONE_NO1" VARCHAR2(100),
         "MOBILE_NO" VARCHAR2(25),
         "EMAIL" VARCHAR2(1000),
         "ADDRESS1" VARCHAR2(4000),
         "CUST_ID" NUMBER,
         "UPLOAD_CRM" VARCHAR2(10),
          CONSTRAINT "VCV_PK" PRIMARY KEY ("SBU_CODE", "CODE", "CONTACT_CODE") ENABLE
    ORA-01400: cannot insert NULL into ("FH_TAPROD"."VENDOR_CUSTOMER_CONTACT"."CODE") ORA-06512: at "FH_TAPROD.AFT_INS_CRM_CUSTOMER_CONTACTS", line 30 ORA-04088: error during execution of trigger 'FH_TAPROD.AFT_INS_CRM_CUSTOMER_CONTACTS'How to resolve it.
    Thanks
    Edited by: 805629 on Jan 14, 2011 1:26 AM

    This is your trigger
    CREATE OR REPLACE TRIGGER  "AFT_INS_CRM_CUSTOMER_CONTACTS"
      AFTER INSERT ON FH_TAPROD.CRM_SALES_CUSTOMER_CONTACTS
    FOR EACH ROW
    DECLARE
    custo_id NUMBER;
    var_code varchar2(8);
    cont_code varchar2(5);
    BEGIN
    SELECT CUSTOMER_ID INTO custo_id FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =:NEW.ID;
      select CODE into var_code from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=custo_id ;
      SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') into cont_code FROM vendor_customer_contact;
      insert into VENDOR_CUSTOMER_CONTACT(SBU_CODE ,CODE,CONTACT_CODE, CONTACT_NAME ,PHONE_NO1 ,MOBILE_NO ,EMAIL, ADDRESS1,CUST_ID,UPLOAD_CRM) values('0002',var_code,cont_code,:NEW.CONTACT_NAME,:NEW.CONTACT_PHONE,:NEW.CONTACT_CELL,:NEW.CONTACT_EMAIL,:NEW.CONTACT_ADDRESS,custo_id,'CRM');
    END;This is the insert who fire it
    INSERT INTO CRM_SALES_CUSTOMER_CONTACTS VALUES (204414862717175278810736770347803084847, 204232590877603599356756434170666837075, 'SANJAY',    '[email protected]', 1246456, 57152357,'Near Post Office');Then the trigger execute
    SELECT CUSTOMER_ID FROM CRM_SALES_CUSTOMER_CONTACTS WHERE ID =204232590877603599356756434170666837075;
    select CODE from VENDOR_CUSTOMER_MAS where CRM_CUST_ID=<result of previous query>;
    SELECT LPAD ( NVL(MAX(CONTACT_CODE), 0)+ 1, 5, '0') FROM vendor_customer_contact;
    Insert ...And fail.
    Execute the select in your sqlplus one by one and post result.

  • "creta user" in an "after insert" table trigger

    Dear members,
    I'm having trouble when I want to create an oracle user in a trigger after inserting in a table.
    It says that I don't have privileges to do so, but my user is DBA, and I can create a new user directly with no problem from this user.
    Do I need a special privilege for some actions through a trigger ?
    Is user creation possible at all in such a trigger ?
    Thanks for your help.

    My guess is that you have the create user privilege granted to you through a role, not directly. Stored procedures don't know about privileges you have through roles.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Reminder mail to users after expiry of their password

    Hi All,
    Does OAM able to send reminder mail to users after expiry of their password? If yes how?
    Regds
    Manoj

    Sounds like you are looking for something like a thread that watches the age of the password in the directory and notifies the user when an 'expiry' event is detected (based on the clock).
    There is nothing in the product that is time or 'monitor' based. You could easily build such a service and execute it from the system (cron / scheduled tasks). Consume obPasswordCreationDate and work your magic from there. I've also had some good success building on such features using quartz [http://www.opensymphony.com/quartz/].
    All OAM event process are based on user initiated events - login in the case of password expiry notification warning.
    Mark

  • How to send e-mail when a trigger condition is verified?

    Hi,
    I want to implement a trigger to send an e-mail when the condition of the tigger is verified.
    Thanks in advance.
    Paulo.

    i'm using the sample code you can find at http://otn.oracle.com/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html to implement the mail function.
    Check out you gateway configuration cause i had some problems with it at the beginning
    my trigger goes like this (i use it to receive a mail everytime i have a exception in one of my processes):
    create or replace trigger TRG_error_handle
    after insert on errores
    for each row
    begin
    demo_mail.mail(sender => "sendername", recipients => "your emailadress",
    subject => 'Error en reporte ' || :new.proceso,
    message => 'Ha ingresado un error de aplicación a las ' ||
    to_char(:new.fecha, 'hh24:mi:ss') || ' del ' ||
    to_char(:new.fecha, 'dd/mm/yyyy') || chr(13) ||
    ' Proceso: ' || :new.proceso || chr(13) ||
    ' Mensaje de error: ' || :new.err_desc);
    end if;
    end TRG_error_handle;
    Good luck.-

  • After Insert Trigger with DML on the subject table?

    I am trying to set up e-mail notifications, so I created a procedure, which accepts the argument of an id. In the procedure, it queries the table and sends out mail based on the result set. (in the trigger, I pass in the value of :NEW.id). The procedure then queries the table for that row id.
    First, for the after update I was getting the error:
    ORA-04091: table is mutating, trigger/function may not see it ORA-06512
    So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem there. SO I did the same in the after insert trigger, but then I get the error:
    ORA-00060: deadlock detected while waiting for resource ORA-06512
    I asked our DBA and he said you are not able to query the table of which the trigger is a subject of. I thought it would be possible since its After insert or update?
    Can anyone offer any suggestions ? :)
    Thanks,
    Trent

    Any reason why it would work in an after update trigger then?
    So, I was advised to do in the declare block: pragma autonomous_transaction; I did that, and that solved the problem therePRAGMA AUTONOMOUS_TRANSACTION "bends" the restriction against SQL against base table.
    It is the equivalent to tap dancing across a mine field.
    You might get the desired results most of the time or you might get a tasty surprise when you least expect it.
    What happens to your application in the future, if/when the UPDATE has a ROLLBACK issued & PRAGMA AUTONOMOUS_TRANSACTION has successfully completed?
    Inquiring minds would like to know the answer.

  • How to send e-mail notification automatically when a record is inserted?

    Dear All,
    Could anyone kindly tell me how to send e-mail notification automatically when a record is inserted through a form in Oracle Portal Release 2?
    Regards,
    Ridwan.

    Hi,
    If you are writing a form on a table then you can call the mail API from a database trigger on the table. If it is a form on a procedure, you can make the email call from the procedure. To know more about sending mails from plsql go to
    http://www.quest-pipelines.com/newsletter-v2/smtp.htm
    Thanks,
    Sharmila

  • Calling of Stored Procedure in After Insert Trigger

    Can I call a Stored Procedure in After Insert Trigger ?
    Please send a sample code (good example) of After Insert Trigger.
    Thanks.

    Kishore,
    I have two table WLCS_ORDER, WLCS_ORDER_LINE
    WLCS_ORDER - It holds order header information like
    ORDER_ID
    CUSTOMER_ID
    TRANSACTION_ID
    STATUS
    ORDER_DATE
    SHIPPING_METHOD
    SHIPPING_AMOUNT
    SHIPPING_CURRENCY
    PRICE_AMOUNT
    PRICE_CURRENCY
    SHIPPING_GEOCODE
    SHIPPING_STREET1
    SHIPPING_STREET2
    SHIPPING_CITY
    SHIPPING_STATE
    SHIPPING_COUNTRY
    SHIPPING_POBOX
    SHIPPING_COUNTY
    SHIPPING_POSTAL_CODE
    SHIPPING_POSTAL_CODE_TYPE
    SPECIAL_INSTRUCTIONS
    SPLITTING_PREFERENCE
    ORDER_SUBTOTAL
    WLCS_ORDER_LINE - It holds all order lines information like
    ORDER_LINE_ID
    QUANTITY
    PRODUCT_ID
    TAX_AMOUNT
    TAX_CURRENCY
    SHIPPING_AMOUNT
    SHIPPING_CURRENCY
    UNIT_PRICE_AMOUNT
    UNIT_PRICE_CURRENCY
    MSRP_AMOUNT
    MSRP_CURRENCY
    DESCRIPTION
    ORDER_ID
    TOTAL_LINE_AMOUNT
    Relation between WLCS_ORDER, WLCS_ORDER_LINE is one to many.
    For each WLCS_ORDER row, one or more order lines will insert into WLCS_ORDER_LINE table.
    For each new row in WLCS_ORDER table, I have to update the following columns in both the tables with my maths.
    WLCS_ORDER
    shipping_amount
    price_amount
    order_subtotal
    WLCS_ORDER_LINE
    shipping_amount
    I thought I can do this in after insert trigger, But if it is not possible, Please give the best way to fulfill this requirement.
    I appreciate your help.
    Have a great day.
    Srinivas

  • Using Database Change Notification instead of After Insert Trigger

    Hello guys! I have an after insert trigger that calls a procedure, which in turn is doing an update or insert on another table. Due to mutating table errors I declared the trigger and procedure as autonomously transactional. The problem is, that old values of my main tables are inserted into the subtable since the after insert/update trigger is fired before the commit.
    My question is how can I solve that and how could I use the change notification package to call my procedure? I now that this notification is only started after a DML/DDL action has been commited on a table.
    If you could show me how to carry out the following code with a Database Change Notification I'd be delighted. Furthermore I need to know if it suffices to set up this notification only once or for each client seperately?
    Many thanks for your help and expertise!
    Regards,
    Sebastian
    declare
    cnumber number (6);
    begin
    select count(*) into cnumber from (
    select case when (select date_datum
        from
          (select f.date_datum,
            row_number() over (order by f.objectid desc) rn
          from borki.fangzahlen f
          where lng_falle      = :new.lng_falle
          and int_fallennummer = :new.int_fallennummer
          and lng_schaedling   = :new.lng_schaedling
          and date_datum       > '31.03.2010'
        where rn=1) < (select date_datum
        from
          (select f.date_datum,
            row_number() over (order by f.objectid desc) rn
          from borki.fangzahlen f
          where lng_falle      = :new.lng_falle
          and int_fallennummer = :new.int_fallennummer
          and lng_schaedling   = :new.lng_schaedling
          and date_datum       > '31.03.2010'
        where rn=2) then 1 end as action from borki.fangzahlen
            where lng_falle      = :new.lng_falle
            and int_fallennummer = :new.int_fallennummer
            and lng_schaedling   = :new.lng_schaedling
            and date_datum       > '31.03.2010') where action = 1;
    if cnumber != 0 then
    delete from borki.tbl_test where lng_falle = :new.lng_falle
    and int_fallennummer = :new.int_fallennummer
    and lng_schaedling   = :new.lng_schaedling
    and date_datum       > '31.03.2010';
    commit;     
    pr_fangzahlen_tw_sync_sk(:new.lng_falle, :new.int_fallennummer, :new.lng_schaedling);

    It looks like you have an error in line 37 of your code. Once you fix that the problem should be resolved.

Maybe you are looking for

  • How to suppress printing of pages with no data

    Dear all, My report consists of 3 distinct sub reports. The first two sub reports should be printed as portrait on A-4 sheet while the third one should be printed as landscape A-4 . I have put the first two sub reports layout in the main section with

  • How do I find out how much memory can my macbook upgraded?

    How do I find out how much memory can my macbook upgraded?

  • I am moving my ipod classic from a pc to my new mac

    I am moving my ipod to my new Mac and no longer have physical access to the pc. So I think I need to move my library and reformat. I am confused about the resetting or reformatting part. I think I understand that I have to download a manager program

  • Monitor flickers

    Greetings, I have a new mac mini with 16 mb memory, 2 T hd and acer 24" monitor connected to the DVI to usb connection. Latley and from some unknow reason , the monitor flickers every once and a while. Is there an issue with the mac mini? Or the vide

  • Yosemite and auto start

    Does anyone know how to to set up an application to auto start on boot up? Doesn't seem to work in Yosemite-.you set it up-.but when it reboots nothing changes Thanks for any help Marilyn