DML ERROR LOGGING - how to log 1 constraint violation on record

Hi there
We are using DML error logging to log records which violate constraints into an error table.
The problem is when a record violates > 1 constraint it logs the record but details only 1 constraint violation - is there a way to get it to record all constraint violations on an individual record.
Many Thanks

In the Netherlands several years ago a framework called CDM RuleFrame was introduced that did just this. Their main thought was that it is desirable to collect all error messages from one transaction and display them all at the end of the transaction.
[url http://www.dulcian.com/papers/ODTUG/2001/BR%20Symposium%202001/Boyd_BR.htm]Here is an article that explains the concept.
In short: it involves coding every single business rule as a database trigger using transaction management of CDM RuleFrame.
I would not recommend it however, because I think [url http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html]database triggers are evil. However, it may appeal to first time users of an application.
Hope this helps.
Regards,
Rob.
Message was edited by:
Rob van Wijk
But if cannot be "turned on" by some switch: you have to design your system this way. So the short answer to your question is: no, it is not possible.

Similar Messages

  • ORA-02292 Constraint violation - child records found

    Hi All,
    When i am trying to get the name of the constraints for that particular table i get
    SQL> SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME='SYSADM.STORAGE_MEDIUM';
    no rows selected
    So what to do next

    Vikas Kohli wrote:
    Hi All,
    When i am trying to get the name of the constraints for that particular table i get
    SQL> SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME='SYSADM.STORAGE_MEDIUM';
    no rows selected
    So what to do nextWhat is output of :
    SQL> SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME='STORAGE_MEDIUM' AND OWNER='SYSADM';
    Regards
    Girish Sharma

  • ORA-00001 Unique constraint Violation Error

    We are upgrading our NW BW 7.01 java server to 7.3 and during the Downtime phase of the Installer, while running the Offline Migration, we are getting an error "EP-KM-BC: Unique Constraint Violation error: ORA-000001".  Unknown Object# (12xxxxxx) does not exist. We have one CI and two DI. Any help would be greatly appreciated.

    Hi Anil,
    You need to clear the data from the table
    1. SHD_AP_PROPVALUE
    2. SHD_KMC_AP_PROP
    3. SHD_AP_MC
    Repeat the phase and also follow the sapnote
    1873288 - RUN_OFFLINE_MIGRATION phase fails during SAP NetWeaver migration
    Also paste the logs of RUN_OFFLINE_MIGRATION phase.
    With Regards
    Ashutosh Chaturvedi

  • When occurs crash recovery,why use active online redo log not archived log?

    If current redo log had archived, but it's still 'ACTIVE'. As we all know, archived log is just an archived copy of the current redo log which is still 'ACTIVE', they have the same data. But why use active online redo log not archived log for crash recovery?(I think, if crash recovery can use archived log, then whether the online redo log is 'ACTIVE' or not, it can be overwritten)
    Quote:
    Re: v$log : How redo log file can have a status ACTIVE and be already archived?
    Hemant K Chitale
    If your instance crashes, Oracle attempts Instance Recovery -- reading from the Online Redo Logs. It doesn't need ArchiveLogs for Instance Recovery.
    TanelPoder
    Whether the log is already archived or not doesn't matter here, when the instance crashes, Oracle needs some blocks from that redolog. Archivelog is just an archived copy of the redolog, so you could use either the online or achive log for the recovery, it's the same data in there (Oracle reads the log/archivelog file header when it tries to use it for recovery and validates whether it contains the changes (RBA range) in it what it needs).

    Aman.... wrote:
    John,
    Are you sure that the instance recovery (not the media recovery) would be using the archived redo logs? Since the only thing that would be lost is the isntance, there wouldn't be any archived redo log generated from the Current redo log and the previous archived redo logs, would be already checkpointed to the data file, IMHO archived redo logs won't participate in the instance recovery process. Yep, shall watch the video but tomorrow .
    Regards
    Aman....
    That's what I said. Or meant to say. If Oracle used archivelogs for instance recovery, it would not be possible to recover in noarchive log mode. So recovery relies exclusively on the online log.
    Sorry I wasted your time, I'll try to be less ambiguous in future

  • Java.lang.LinkageError: loader constraint violation

    I am using ToplinkEssentials as a persistence provider in a J2SE desktop application. I've encountered the following error.
    java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "expendituretracking/Employee"
    I have unsuccessfully searched for a clue as to what is causing this problem. Any help is appreciated.

    Hello,
    Could this be related to the bug described at:
    https://glassfish.dev.java.net/issues/show_bug.cgi?id=2625
    If you have an interface involved, try adding them to the persistence.xml's list of classes.
    Best Regards,
    Chris

  • How to debug and find the exact constraint violation error

    {122712 14:22:36:ErrorCode -1 with ErrorMessage as ORA-00001: unique constraint (OPS$CMS.PK_TB_ML_EXER_UPLOAD) violated has occured for [SSO16063259009], [CMSCOST_USER] pk_xop_subsales.pr_process_exer }
    {PROCEDURE pr_process_exer(
    p_voucher_num           tb_xop_order_manager_t.voucher_num%TYPE,
    p_status_type           tb_xop_order_manager_t.status_type%type,
    p_dest                    tb_xop_order_manager_t.dest%type,
    p_reference_key            tb_xop_order_manager_t.reference_key%type,
    p_seq_num                tb_xop_order_manager_t.seq_num%type,
    p_return_code            tb_xop_order_manager_t.return_code%type,
    p_reason_desc           tb_xop_order_manager_t.reason_desc%type,
    p_activity_qty            tb_xop_order_manager_t.activity_qty%type,
    p_leaves_qty            tb_xop_order_manager_t.leaves_qty%type,
    p_exec_price            tb_xop_order_manager_t.exec_price%type,
    p_current_status        tb_xop_order_manager_t.current_status%type,
    p_err_cur          OUT  ref_cursor)
    IS
    CURSOR get_order_dtls(v_voucher_num tb_xop_order_manager_t.voucher_num%type)
    IS
    SELECT *
    FROM   tb_xop_order_manager_t
    WHERE  voucher_num = v_voucher_num;
    CURSOR get_mail_cd(v_opt_num OPTIONEE.opt_num%TYPE) IS
          SELECT mail_cd, sp_mail_cd
          FROM XOP_OPTIONEE
          WHERE opt_num = v_opt_num;
    cursor get_opt_dtls(v_opt_num OPTIONEE.opt_num%TYPE) IS
    select
    SUBSTR(trim(O.name_first) || ' ' || trim(O.name_mi) || ' ' ||
              trim(O.name_last), 1, 35) p_name,
            SUBSTR(O.address1, 1, 35) opt_addr1,
              SUBSTR(O.address2, 1, 35) opt_addr2,
              SUBSTR(O.address3, 1, 35) opt_addr3,
              SUBSTR(O.address4, 1, 35) opt_addr4,
              SUBSTR(O.address5, 1, 35) opt_addr5,
              SUBSTR(O.address6, 1, 35) opt_addr6,
            SUBSTR(trim(O.city) || ' ' || trim(O.state) || ' ' ||
            trim(O.zip) || ' ' || trim(O.country), 1, 35) city_state_zip_country,
            trim(O.city) city,
            trim(O.state) state,
            trim(O.zip) zip,
            trim(O.country) country
    from  optionee o
    where o.opt_num = v_opt_num;
    --CQ:PCTUP00210726- Added wire instructions audit for deleted wire info.
    CURSOR c_wire_instruction (
          in_wire_seq_no           TB_XOP_WIRE_INSTRUCTIONS.wire_seq_no%TYPE ) IS
          SELECT ml_brok_acct_num,
                 ssn,
                 plan_num,
                 instr_type,
                 aba_routing_num,
                 swift_routing_code,
                 bank_name,
                 bank_acct_num,
                 name_on_account,
                 bank_addr_1,
                 bank_addr_2,
                 bank_addr_3,
                 city,
                 state,
                 country,
                 zip,
                 bank_ident_num,
                 addtl_info
            FROM TB_XOP_WIRE_INSTRUCTIONS
           WHERE wire_seq_no = in_wire_seq_no
           UNION
           SELECT ml_brok_acct_num,
                 ssn,
                 plan_num,
                 instr_type,
                 aba_routing_num,
                 swift_routing_code,
                 bank_name,
                 bank_acct_num,
                 name_on_account,
                 bank_addr_1,
                 bank_addr_2,
                 bank_addr_3,
                 city,
                 state,
                 country,
                 zip,
                 bank_ident_num,
                 addtl_info
            FROM TB_XOP_WIRE_INSTRUCTIONS_AUDIT
           WHERE wire_seq_no = in_wire_seq_no;
    CURSOR c_order_qty IS
    SELECT order_qty
    FROM tb_xop_order_manager
    WHERE voucher_num = p_voucher_num;
    v_order_qty     tb_xop_order_manager.order_qty%TYPE;
    v_wire_instruction             c_wire_instruction%ROWTYPE;
    v_order_dtls      get_order_dtls%rowtype;
    v_opt_dtls        get_opt_dtls%rowtype;
    v_settle_dt       tb_ml_exer_upload.settle_dt%type;
    v_cusip_num       corp.cusip_num%type;
    v_err_cd          number(12):=0;
    v_err_msg         varchar2(4000);
    v_compy_nme       tb_fc_Compy.compy_nme%type;
    v_ml_sec_num      tb_fc_compy.ml_sec_num%type;
    v_mail_cd         xop_optionee.mail_cd%type;
    v_count1            PLS_INTEGER := 0;
    v_sum_activity_qty  tb_xop_order_manager_t.activity_qty%TYPE;
    v_transact_no       PLS_INTEGER;
    v_ivr_plan_num      tb_fc_compy.ivr_plan_num%TYPE;
    wait_for_more       EXCEPTION;
    exceeds_order_qty   EXCEPTION;
    --Added for CQ# PCTUP00481233
    v_sub_totfee number;
    v_sub_fixedfee1 number;
    v_sub_fixedfee2 number;
    v_sub_fixedfee3 number;
    v_sub_secfee number;
    v_sub_feenum number;
    --Added for CQ# PCTUP00481233
    v_fixedfee1 tb_xop_order_manager_t.fixed_fee1%TYPE; --SPIF# 43161- variable to hold fixed fee1
    BEGIN
        OPEN c_order_qty;
        FETCH c_order_qty INTO v_order_qty;
        CLOSE c_order_qty;
        dbms.output.put_line('completed1');
        IF v_order_qty <> p_activity_qty THEN
          dbms.output.put_line('completed2');
            IF p_status_type = 'EO' AND v_order_qty < p_activity_qty THEN
                RAISE exceeds_order_qty;
                  dbms.output.put_line('completed3');
            ELSIF p_status_type = 'EO' AND v_order_qty > p_activity_qty THEN
                -- Partial Execution
                INSERT INTO tb_xop_hold_multi_orders
                    ( voucher_num
                    , reference_key
                    , seq_num
                    , return_code
                    , reason_desc
                    , status_type
                    , activity_qty
                    , leaves_qty
                    , exec_price
                    , current_status
                    , waiting
                    ,activ_dt )
                VALUES
                    ( p_voucher_num
                    , p_reference_key
                    , p_seq_num
                    , p_return_code
                    , p_reason_desc
                    , p_status_type
                    , p_activity_qty
                    , p_leaves_qty
                    , p_exec_price
                    , p_current_status
                    , 'Y'
                    ,SYSTIMESTAMP );
                      dbms.output.put_line('completed4');
            ELSE
                IF p_status_type = 'BE' THEN
                    SELECT COUNT(1) INTO v_count1
                    FROM tb_xop_hold_multi_orders
                    WHERE voucher_num = p_voucher_num;
                      dbms.output.put_line('completed5');
                    IF v_count1 > 0 THEN
                        INSERT INTO tb_xop_hold_multi_orders
                            ( voucher_num
                            , reference_key
                            , seq_num
                            , return_code
                            , reason_desc
                            , status_type
                            , activity_qty
                            , leaves_qty
                            , exec_price
                            , current_status
                            , waiting
                            ,activ_dt)
                        VALUES
                            ( p_voucher_num
                            , p_reference_key
                            , p_seq_num
                            , p_return_code
                            , p_reason_desc
                            , p_status_type
                            , (-1) * p_activity_qty
                            , p_leaves_qty
                            , p_exec_price
                            , p_current_status
                            , 'Y'
                            ,SYSTIMESTAMP );
                        UPDATE tb_xop_hold_multi_orders
                        SET waiting = 'Y'
                        WHERE voucher_num = p_voucher_num;
                          dbms.output.put_line('completed6');
                    END IF;
                END IF;
            END IF;
              dbms.output.put_line('completed7');
            SELECT SUM(NVL(activity_qty,0)) INTO v_sum_activity_qty
            FROM tb_xop_hold_multi_orders
            WHERE waiting = 'Y'
            AND voucher_num = p_voucher_num;
            IF v_sum_activity_qty > 0 THEN
                IF v_sum_activity_qty <> v_order_qty THEN
                    RAISE wait_for_more;
                ELSE
                    -- final order in the partial execution; complete the process
                    UPDATE tb_xop_hold_multi_orders
                    SET waiting = 'N'
                        , process_dt = SYSDATE
                    WHERE voucher_num = p_voucher_num;
                END IF;
            END IF;
        END IF;
        UPDATE tb_xop_order_manager_t
        SET activ_dt = TO_CHAR( SYSDATE, 'YYYY-MM-DD HH24:MI:SS' ) || '.000'
            , dest = p_dest
            , reference_key = p_reference_key
            , seq_num = p_seq_num
            , return_code = p_return_code
            , reason_desc = p_reason_desc
            , status_type = p_status_type
            , activity_qty = v_order_qty --p_activity_qty
            , leaves_qty = 0 --p_leaves_qty
            , exec_price = p_exec_price
        WHERE voucher_num = p_voucher_num;
        dbms.output.put_line('completed8');
         * SPIF# 43161- Update of current status to PO moved at the end, same as how PROD works.
    IF (p_status_type = 'EO') THEN
      BEGIN
        select cusip_num
          into   v_cusip_num
          from   corp;
      EXCEPTION
          WHEN NO_DATA_FOUND THEN
              SELECT cusip_num
                INTO v_cusip_num
                FROM tb_xop_espp_compy
               WHERE compy_acronym = replace(replace(user,'CMS'),'_USER');
          WHEN OTHERS THEN
              NULL;
      END;
       select compy_nme,ml_sec_num, ivr_plan_num
       into   v_compy_nme,v_ml_sec_num, v_ivr_plan_num
       from   tb_fc_compy
       where compy_acronym = replace(replace(user,'CMS'),'_USER')
       UNION ALL
       select compy_nme, je_ml_security_number, ivr_plan_num
       from tb_xop_espp_compy
       where compy_acronym = replace(replace(user,'CMS'),'_USER');
    --   where  ivr_plan_num = replace(substr(p_voucher_num,1,7),'SSO','XOP');
      open get_order_dtls(p_voucher_num);
      FETCH get_order_dtls INTO v_order_dtls;
       v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_order_dtls.exer_date + 1));
       v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_settle_dt + 1));
       v_settle_dt := fn_xop_bankopen_bizday(TRUNC(v_settle_dt + 1));
       FOR c_mail_cd IN get_mail_cd(v_order_dtls.opt_num)
       LOOP
         v_mail_cd := c_mail_cd.mail_cd;
         -- Do we need to get sp_mail_cd and overlay with the sp_mail_cd in order_manager_t???
       END LOOP;
       OPEN get_opt_dtls(v_order_dtls.opt_num);
       FETCH get_opt_dtls INTO v_opt_dtls;
       CLOSE get_opt_dtls;
      v_fixedfee1 := nvl(v_order_dtls.fixed_fee1, 0);
       * SPIF# 43161- atleast one handling fee per day of transaction
      v_fixedfee1 := pk_xop_enh_exerupdate.chrg_tranxfixed_fee(v_fixedfee1,
                                                               v_order_dtls.symbol,
                                                               v_order_dtls.corp_acronym,
                                                               v_order_dtls.opt_num);
      --Insert into tb_ml_exer_upload
      --Added for CQ# PCTUP00481233
       Pk_Xop_Transactmodel.GET_FEE(v_order_dtls.GROUP_ID,v_order_dtls.SVC_ID,'SQ',v_order_dtls.opts_exer,
                                    round(v_order_dtls.exec_price, 4),v_sub_totfee,v_sub_fixedfee2,v_sub_fixedfee1,
                                    v_sub_fixedfee3,v_sub_secfee,v_sub_feenum,lpad(v_order_dtls.ssn,9,0));
       v_order_dtls.sec_fee:=v_sub_secfee;
       UPDATE tb_xop_order_manager_t
        SET sec_fee=v_sub_secfee
        WHERE voucher_num = p_voucher_num;
        dbms.output.put_line('completed8');
      --- End CQ # PCTUP00481233
      INSERT INTO tb_ml_exer_upload
                            (exer_num,exer_seq,
                             exer_dt, written_flag, backout_flag, output_line,
                             je_flag, opts_exer,
                             tot_tax,shrs_sold,comm_value,tot_fee,
                             mkt_prc,exer_type, soc_sec,
                             name_first, name_mi,
                             name_last,check_addr_1,check_addr_2,check_addr_3,
                             check_addr_4,check_addr_5,city,state,zip,country,
                             city_state_zip_country,
                             p_name,opt_addr1,opt_addr2,opt_addr3,opt_addr4,
                             opt_addr5,opt_addr6,
                             settle_dt,send_to_citibank_flag,
                             dom_chek_distr,foreign_currency_code,
                             distribution_method,wire_seq_no,
                             cusip_num, ml_retail_account,multi_curr_handling_fee,
                             ml_sec_num, corp_name,upd_optionee_addr,
                             outbound_flag, -- make it N
                             corp_symbol,taxwire_approve, -- make it not applicaplabe
                             exersource,
                             mail_cd, sp_mail_cd,
                             backup_withholding,
                             user_id,
                             acct_num_othr)
       VALUES(v_order_dtls.exer_num,0,v_order_dtls.exer_date,'N','N',NULL,
    -- PG 12/12/05 Changed to populate the je_flag based on dom_chek_distr         'D',
    -- PG 12/16/05 JE should not be generated for international checks.. So 'Y' always
              'Y', --je_flag
              v_order_dtls.opts_exer,0,--total tax will be 0.
              v_order_dtls.opts_exer, --shrs_sold,
              v_order_dtls.comm_value,
              --SPIF# 43161- replaced nvl(v_order_dtls.fixed_fee1, 0) with v_fixedfee1
              v_fixedfee1 + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0), --v_order_dtls.fees_amt,
              round(v_order_dtls.exec_price, 4),v_order_dtls.exer_type,
              LPAD(v_order_dtls.ssn,9,'0'), --v_order_dtls.ssn, Modified by Suresh on 02/08/07 for SPIF # 37210
              v_order_dtls.name_first,v_order_dtls.name_mi,v_order_dtls.name_last,
              v_order_dtls.check_addr_1,v_order_dtls.check_addr_2,v_order_dtls.check_addr_3,
              v_order_dtls.check_addr_4,v_order_dtls.check_addr_5,nvl(v_order_dtls.city,v_opt_dtls.city),
              nvl(v_order_dtls.state,v_opt_dtls.state),nvl(v_order_dtls.zip,v_opt_dtls.zip),
              nvl(v_order_dtls.country,v_opt_dtls.country),
              SUBSTR(nvl(v_order_dtls.city||v_order_dtls.state||v_order_dtls.zip||v_order_dtls.country,
                  v_opt_dtls.city_state_zip_country),1,34), -- COLUMN LENGTH MAX IS 35
              v_opt_dtls.p_name,v_opt_dtls.opt_addr1,v_opt_dtls.opt_addr2,v_opt_dtls.opt_addr3,
              v_opt_dtls.opt_addr4,v_opt_dtls.opt_addr5,v_opt_dtls.opt_addr6,
              v_settle_dt,decode(v_order_dtls.distribution_method,'W','Y','D','Y','C','Y','D'),
              v_order_dtls.dom_chek_distr,v_order_dtls.foreign_currency_code,
              v_order_dtls.distribution_method,v_order_dtls.wire_seq_no,
              v_cusip_num,v_order_dtls.acct_num,v_order_dtls.multi_curr_handling_fee,
    --          nvl(fn_get_sec_num(replace(substr(p_voucher_num,1,7),'SSO','XOP'),v_order_dtls.symbol),v_ml_sec_num),
              nvl(fn_get_sec_num(v_ivr_plan_num, v_order_dtls.symbol),v_ml_sec_num),
              v_compy_nme,v_order_dtls.upd_optionee_addr,
              'N', --'N' is for outbound flag.
              v_order_dtls.symbol,'D', --'D' for taxwires disabled
              'S', -- 'S' for source being subsequent sale.
              v_mail_cd,  --need to get mail_Cd??
              v_order_dtls.sp_mail_cd,v_order_dtls.backup_withholding,
              user,v_order_dtls.acct_num_othr);
    IF (NVL(v_order_dtls.wire_seq_no,0) > 0) THEN
       OPEN c_wire_instruction(v_order_dtls.wire_seq_no);
       FETCH c_wire_instruction INTO v_wire_instruction;
       CLOSE c_wire_instruction;
      INSERT INTO TB_XOP_TRANSACT_WIRE_INSTR
                           (user_id, exer_num, wire_seq_no, ml_brok_acct_num, ssn,
                            plan_num, instr_type, aba_routing_num,
                            swift_routing_code, bank_name, bank_acct_num,
                            name_on_account, bank_addr_1, bank_addr_2, bank_addr_3,
                            city, state, country, zip, bank_ident_num, addtl_info )
                        VALUES
                           (USER,v_order_dtls.exer_num, v_order_dtls.wire_seq_no,
                            v_wire_instruction.ml_brok_acct_num, v_wire_instruction.ssn,
                            v_wire_instruction.plan_num, v_wire_instruction.instr_type, v_wire_instruction.aba_routing_num,
                            v_wire_instruction.swift_routing_code, v_wire_instruction.bank_name, v_wire_instruction.bank_acct_num,
                            v_wire_instruction.name_on_account, v_wire_instruction.bank_addr_1, v_wire_instruction.bank_addr_2,
                            v_wire_instruction.bank_addr_3, v_wire_instruction.city, v_wire_instruction.state, v_wire_instruction.country, v_wire_instruction.zip,
                             v_wire_instruction.bank_ident_num, v_wire_instruction.addtl_info);
            dbms.output.put_line('completed10');
    END IF;
    /* PG 01/05/06 Call the check conversion only for international checks and wires */
    IF v_order_dtls.dom_chek_distr = 'N' AND v_order_dtls.distribution_method IN ('W', 'D', 'C') THEN
        /* PG 12/20/05 To process subsequent sales with wire or foreign currency distribution */
         v_transact_no := 88;
         pk_xop_citibank_forex.pr_cashconversion_ins_request( v_order_dtls.acct_num
                                                              , LPAD(v_order_dtls.ssn,9,'0') --v_order_dtls.ssn, Modified by Suresh on 02/15/07 for SPIF # 37210
                                                              , v_order_dtls.distribution_method
                                                              , v_order_dtls.foreign_currency_code
                                                              , v_order_dtls.wire_seq_no
                                                              , ROUND((v_order_dtls.opts_exer * round(v_order_dtls.exec_price, 4)),2)
                                                                - ROUND(v_order_dtls.comm_value,2)
                                                                - ROUND(nvl(v_order_dtls.fixed_fee1,0) + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0),2)
                                                                - nvl(v_order_dtls.multi_curr_handling_fee,0)
                                                                - nvl(v_order_dtls.backup_withholding,0) -- net proceeds
                                                              , v_order_dtls.multi_curr_handling_fee --handling fee
                    --Modified by Bhaskar/Suresh on 03/02/2006    --, v_order_dtls.login_name
                                                              , CASE v_order_dtls.login_name WHEN 'CLIENT/' THEN v_order_dtls.login_name||'SSO' ELSE v_order_dtls.login_name||'/SSO' END
                                                              , v_transact_no -- transact_no as place holder for exer_type 88
                                                              , v_order_dtls.check_addr_1
                                                              , v_order_dtls.check_addr_2
                                                              , v_order_dtls.check_addr_3
                                                              , v_order_dtls.check_addr_4
                                                              , v_order_dtls.upd_optionee_addr
                                                              , v_order_dtls.city
                                                              , v_order_dtls.state
                                                              , v_order_dtls.zip
                                                              , v_order_dtls.country
                                                              , v_order_dtls.login_ipaddress
                                                              , v_order_dtls.fcnum
                                                              , v_order_dtls.opt_num
                                                              , v_settle_dt,
                                                              p_exer_num => v_order_dtls.exer_num
    END IF;
    COMMIT;
    close get_order_dtls;
    END IF;
      * SPIF# 43161- Update to current status into PO is moved to this part, same as PROD.
    UPDATE tb_xop_order_manager_t
    SET exec_dttime = decode(p_status_type,'EO',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),null)
         , exer_date  = TRUNC(SYSDATE)
         , cancel_dttime = decode(p_status_type,'CX',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),'UR',to_char(sysdate,'DD-MON-YYYY HH24:mi:ss'),null)
         , current_status = 'PO'
         , sum_status = decode(p_status_type,'EO','X','C')
         , sum_stat_dttime = SYSDATE
    WHERE voucher_num = p_voucher_num;
          v_err_cd := sqlcode;
          v_err_msg := sqlerrm;
          open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
    EXCEPTION
            dbms.output.put_line('completed200');
    /* PG 02/10 handled 'partial fill order' exception */
      when wait_for_more then
          v_err_cd := 0;
          v_err_msg := 'ORA-0000: normal, successful completion';
          pr_xop_log_errors('Partially filled; Waiting for more - Activity qty:' || to_char(v_sum_activity_qty)|| ' pk_xop_subsales.pr_process_exer');
          open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
      when exceeds_order_qty then
          v_err_cd := sqlcode;
          v_err_msg := sqlerrm;
          open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
          pr_xop_log_errors('Activity quantity exceeded the Order_qty - Activity qty: ' || to_char(p_activity_qty) || ' pk_xop_subsales.pr_process_exer');
      when others then
          v_err_cd := sqlcode;
          v_err_msg := sqlerrm;
          open p_err_cur for select v_err_cd err_code,v_err_msg err_msg from dual;
          pr_xop_log_errors('ErrorCode '||SQLCODE||' with ErrorMessage as '||SQLERRM||' has occured for '||user||'pk_xop_subsales.pr_process_exer');
                dbms.output.put_line('completed125');
    END pr_process_exer;
    Hi friends, any1 help me out how to define the ref-cursor in declaration section, and how to find at what situation the constraint error occurred..

    956684 wrote:
    Hi,.
    Friends plz help me out ..how to debug and find the exact position of the constraint violation..thank you for the help..There isn't a way to trace it unless you have caught the exception raised.
    As a way to start the debug, you will have to monitor
    1. All DML's against the Table on which you have constraint. More specifically, the DML's that act on the column you have constraint on.
    2. Use Exception Handling, to log the Error and the data that causes the constraint to fail.
    3. Do not forget to monitor the Triggers, if they are used, that would write some data into the column you have constraint on.
    Or
    Another way to trace is:
    select *
      from user_source
    where lower(text) like '%your_table_name%';
    order by type, name, line;Look at the lines, exclude that are in Declaration or in SELECT statements and target the DML's.
    Looking at the un-formatted code you posted, this statement looks like a culprit.
    INSERT INTO tb_ml_exer_upload
    (exer_num,exer_seq,
    exer_dt, written_flag, backout_flag, output_line,
    je_flag, opts_exer,
    tot_tax,shrs_sold,comm_value,tot_fee,
    mkt_prc,exer_type, soc_sec,
    name_first, name_mi,
    name_last,check_addr_1,check_addr_2,check_addr_3,
    check_addr_4,check_addr_5,city,state,zip,country,
    city_state_zip_country,
    p_name,opt_addr1,opt_addr2,opt_addr3,opt_addr4,
    opt_addr5,opt_addr6,
    settle_dt,send_to_citibank_flag,
    dom_chek_distr,foreign_currency_code,
    distribution_method,wire_seq_no,
    cusip_num, ml_retail_account,multi_curr_handling_fee,
    ml_sec_num, corp_name,upd_optionee_addr,
    outbound_flag, -- make it N
    corp_symbol,taxwire_approve, -- make it not applicaplabe
    exersource,
    mail_cd, sp_mail_cd,
    backup_withholding,
    user_id,
    acct_num_othr)
    VALUES(v_order_dtls.exer_num,0,v_order_dtls.exer_date,'N','N',NULL,
    -- PG 12/12/05 Changed to populate the je_flag based on dom_chek_distr 'D',
    -- PG 12/16/05 JE should not be generated for international checks.. So 'Y' always
    'Y', --je_flag
    v_order_dtls.opts_exer,0,--total tax will be 0.
    v_order_dtls.opts_exer, --shrs_sold,
    v_order_dtls.comm_value,
    --SPIF# 43161- replaced nvl(v_order_dtls.fixed_fee1, 0) with v_fixedfee1
    v_fixedfee1 + nvl(v_order_dtls.fixed_fee3,0) + nvl(v_order_dtls.sec_fee,0), --v_order_dtls.fees_amt,
    round(v_order_dtls.exec_price, 4),v_order_dtls.exer_type,
    LPAD(v_order_dtls.ssn,9,'0'), --v_order_dtls.ssn, Modified by Suresh on 02/08/07 for SPIF # 37210
    v_order_dtls.name_first,v_order_dtls.name_mi,v_order_dtls.name_last,
    v_order_dtls.check_addr_1,v_order_dtls.check_addr_2,v_order_dtls.check_addr_3,
    v_order_dtls.check_addr_4,v_order_dtls.check_addr_5,nvl(v_order_dtls.city,v_opt_dtls.city),
    nvl(v_order_dtls.state,v_opt_dtls.state),nvl(v_order_dtls.zip,v_opt_dtls.zip),
    nvl(v_order_dtls.country,v_opt_dtls.country),
    SUBSTR(nvl(v_order_dtls.city||v_order_dtls.state||v_order_dtls.zip||v_order_dtls.country,
    v_opt_dtls.city_state_zip_country),1,34), -- COLUMN LENGTH MAX IS 35
    v_opt_dtls.p_name,v_opt_dtls.opt_addr1,v_opt_dtls.opt_addr2,v_opt_dtls.opt_addr3,
    v_opt_dtls.opt_addr4,v_opt_dtls.opt_addr5,v_opt_dtls.opt_addr6,
    v_settle_dt,decode(v_order_dtls.distribution_method,'W','Y','D','Y','C','Y','D'),
    v_order_dtls.dom_chek_distr,v_order_dtls.foreign_currency_code,
    v_order_dtls.distribution_method,v_order_dtls.wire_seq_no,
    v_cusip_num,v_order_dtls.acct_num,v_order_dtls.multi_curr_handling_fee,
    -- nvl(fn_get_sec_num(replace(substr(p_voucher_num,1,7),'SSO','XOP'),v_order_dtls.symbol),v_ml_sec_num),
    nvl(fn_get_sec_num(v_ivr_plan_num, v_order_dtls.symbol),v_ml_sec_num),
    v_compy_nme,v_order_dtls.upd_optionee_addr,
    'N', --'N' is for outbound flag.
    v_order_dtls.symbol,'D', --'D' for taxwires disabled
    'S', -- 'S' for source being subsequent sale.
    v_mail_cd, --need to get mail_Cd??
    v_order_dtls.sp_mail_cd,v_order_dtls.backup_withholding,
    user,v_order_dtls.acct_num_othr);What is the Table structure of tb_ml_exer_upload and what columns do you have constraints on?
    Which column of the table tb_ml_exer_upload is your Primary Key (because constraint name mentions pk_tb_ml_exer_upload)?
    Edited by: Purvesh K on Jan 4, 2013 12:57 PM

  • Alternative to DML Error Logging

    I am supposed to catch invalid records in error table with the ORA exception. I am using 10g. Using DML Error logging i cannot catch primary key violations. Using for loop it will be very slow because there are lots of records. How to catch invalid records with the ORA exception
    Thanks

    user637544 wrote:
    Using DML Error logging i cannot catch primary key violations.You can't use DML Error Logging future, because:
    The DML error logging functionality is not invoked when:
    Deferred constraints are violated.
    Direct-path INSERT or MERGE operations raise unique constraint or index violations.
    UPDATE or MERGE operations raise a unique constraint or index violation.
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • DML Error Logging Tables?

    How can I use DML Error Logging Tables with OWB10gR2 (in tab-definition and mappings)?
    btw: what really is a shadow-table?

    Hi,
    What you can do to solve this is to add a Pre-mapping to your mapping which calls a procedure that alters the constraint on the target table in which you use the "EXCEPTIONS INTO <error_table> " clause.
    like:
    PROCEDURE "ENABLE_CONSTR_WITH_EXCEPTIONS"("P_TABLE" IN VARCHAR2,  "P_CONSTRAINT" IN VARCHAR2) IS
    v_table            varchar2(30) := p_table;
    v_constraint          varchar2(30) := p_constraint;
    v_command           varchar2(200);
    e_CannotValidate      exception;
    PRAGMA EXCEPTION_INIT(e_CannotValidate, -2437);
    -- main body
    BEGIN
    /* Enable Constraint and write error into exception table */
      BEGIN
        v_command := 'ALTER TABLE ' || v_table || ' ENABLE CONSTRAINT '|| v_constraint ||' EXCEPTIONS INTO exceptions';
        execute immediate (v_command);
        commit;
      END;
        EXCEPTION
            WHEN e_CannotValidate THEN
               -- In my case when Unique Constraints are violated I will delete the duplicates.
               DELETE_DUPLICATES(v_table, v_constraint);
            WHEN OTHERS THEN
                NULL;  -- enter any exception code here
    END;
    -- End of ENABLE_CONSTR_WITH_EXCEPTIONS;Greetz,
    Ilona Tielke

  • ORA-02291 - ORA-02063 on merge with dml error logging through DB link

    Hello all,
    I have 2 DB's and I would like to merge records from A into B with dml error logging through a db link.
    Exemple:
    merge into B@dblink
    using (select ... from A where...)
    when matched then
    when not matched then
    log errors into err$_A reject limit unlimited;
    When I use this, and exception is thrown:
    ORA-02291: integrity constraint (B.constraint_name) violated - parent key not found
    ORA-02063: preceding line from dblink
    I've got no idea of what causes this.
    Could anyone please help me ?
    Thanks !
    Regards,
    TDE.

    Hello damorgan,
    Thanks for your answer.
    I've well understood that its was a foreign key violation, and I guess that's an error in the source: wee make only logical deletes, and I'm quite sure the problem is there.
    Anyway, I really would understand why dml error logging doesn't work in this case.
    I'll investigate and keep you informed.
    Regards.

  • DML Error logging table in Set base mode

    Hi all,
    In ETL data errors can be handled thru error logging table. Like this example given in the document-
    INSERT /*+ APPEND PARALLEL */
    INTO sales SELECT product_id, customer_id, TRUNC(sales_date), 3,
    promotion_id, quantity, amount
    FROM sales_activity_direct
    LOG ERRORS INTO sales_activity_errors('load_20040802')
    REJECT LIMIT UNLIMITED
    In this example bulk loading is possible even in the presence of errors. The data errors will go in table 'Sales_activity_errors'.
    I want to generate this kind of coding in OWB in set base mode. For that i have to create a error logging table in target schema. How can I reference this table in a mapping? can it be done by shadow table? It's a very important feature in ETL for bulk loading. Is it available in OWB in set based mode?
    Guyzz please check this out and help me..
    Regards,
    Sumanta

    Hi,
    I am not sure if the DML error logging method is avaliable to be used in OWB 10g R2. You can use the data rule method. Create the data rules on the target table. Deploy it from OWB. Create your mappings and then execute them. Two insert statements will be generated. One for loading the target table for loading records where no rules are violated. The other for loading the <target table>_ERR for loading records where one or more error rules are violated.
    Both these statements do a bulk loading. So your purpose will be solved.
    Again you can use the splitter method that has already been mentioned.
    Regards
    -AP

  • DML Error logging for Update statement

    Hello,
    I am facing a problem with regard to DML Error logging with Update statement .
    oracle : 10.2
    I am executing following DML update:
    BEGIN
    UPDATE
    table_1  a
    SET a.Exp_DATE =a.EFF_DATE
    WHERE  a.col_a1 != (SELECT b.colb1
                         FROM table_2  b
                         WHERE  a.msisdn =b.msisdn )
    LOG ERRORS INTO table_1_ERR REJECT LIMIT UNLIMITED;                        
    END ;    I was expecting that "ORA-01427: single-row subquery returns more than one row" would be captured in LOG error table "table_1_err"
    but instead I got run time error and whole dml was rolled back.
    Please let me know whether this exception is not captured by DML error logging.
    Thanks,
    Abhishek

    *Oracle logs the following errors during DML operations:** Column values that are too large.
    * Constraint violations (NOT NULL, unique, referential, and check constraints).
    * Errors raised during trigger execution.
    * Errors resulting from type conversion between a column in a subquery and the corresponding column of the table.
    * Partition mapping errors.
    >
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/transform.htm#sthref777

  • Dml error logging for tables in 10.2.0.5

    Hi experts,
    I have problems loading error records into the shadow table specified in the configuration window for tables. Upon executing the mapping, the execution results show warnings with the error records but these records were not moved to the shadow/error table.
    The actual scenario is: I specified a non-null data rule on the supplier_code column in the supplier table. Inside the mapping where I used this supplier table, I choose the option "Move to error" for this non-null data rule. Upon executing, it seems that owb treats these as warnings and not errors and thus did not propagate them to the error table. Anyone has any suggestion as to how to make use of the error tables in owb?

    DML error logging is generated for set-based PL/SQL mappings if the following conditions are satisfied:
    1. the Error table name property is set for the operator (table/view/mv)
    2. the PL/SQL Generated Mode of the module that contains the mapping is set to 10gR2 and above or Default.
    If the value is set to Default, ensure that location associated with the module has the Version set to 10.2 or above.
    When you use a data object in a mapping, the Error Table Name property for this data object is derived from the shadow table name property of the data object . If you modify the error table name of a data object (using the shadow table name property), you must synchronize all the operators bound to this data object.
    If you are still facing the issue then provide your email and I can send a simple example of data rule mapping in OWB 10.2.0.5
    Sutirtha

  • DML Error Logging keeps mum

    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionProblem: Trying to insert into mytable and implement DML error logging. But error logging never kicks in instead process fails
    with
    ORA-01843: not a valid monthWhy is that happening? I thought may be direct path insert is the reason behind it. But, Tom Kite himself uses DPI.
    http://tkyte.blogspot.com/2005/07/how-cool-is-this.html
    Any advice?
    INSERT /*+ APPEND */  INTO mytable
    SELECT   A,
             TO_DATE(TRIM(SUBSTR(str,1, INSTR(str, ' to ') - 1)), 'Mon DD YYYY')   csd,
             TO_DATE(TRIM(SUBSTR(str, INSTR(str, ' to ') + 4, INSTR(str, '-') - (INSTR(str, ' to ') + 5))), 'Mon DD YYYY')   ced,
             B,
             C,
             D
      FROM   (SELECT   DISTINCT
                       p1,
                       p2,
                       p3
                FROM P
             ) pc1
             INNER JOIN tbl1 ON (...)
             INNER JOIN tbl2 ON (...)
             INNER JOIN tbl3 ON (...)
    ORDER BY A, B, C
    LOG ERRORS ('my errors') REJECT LIMIT UNLIMITED;

    Thanks! I created a view and put the TO_DATE in the SELECT statement as shown below and DML Logging kicked in where TO_DATE was failing!
    INSERT /*+ APPEND */  INTO mytable
    SELECT   A,
                 TO_DATE(csd, 'Mon DD YYYY')   csd,
                TO_DATE(ced, 'Mon DD YYYY')   ced,
                 B,
                 C,
                 D
    FROM  (SELECT   A,
                           TRIM(SUBSTR(str,1, INSTR(str, ' to ') - 1))  csd,
                           TRIM(SUBSTR(str, INSTR(str, ' to ') + 4, INSTR(str, '-') - (INSTR(str, ' to ') + 5)))  ced,
                            B,
                            C,
                            D
                 FROM   (SELECT   DISTINCT
                                           p1,
                                           p2,
                                           p3
                               FROM P
                            ) pc1
                  INNER JOIN tbl1 ON (...)
                  INNER JOIN tbl2 ON (...)
                  INNER JOIN tbl3 ON (...)
                  ORDER BY A, B, C
    LOG ERRORS ('my errors') REJECT LIMIT UNLIMITED;

  • DML Error logging with delete restrict

    Hi,
    I am trying to log all DML errors while performing ETL process. We encountered a problem in the process when one of the on delete cascade is missing in child tables but I was curious to know why we got that exception to the calling environment because we are logging all DML errors in err$_ tables. Our expectation is when we get child record found violation then that error will be logged into ERR$_ tables and process will carry on without any interruption but it interrupted in the middle and terminated. I can illustrate with below example
    T1 -> T2 -> T3
    T1 is parent and it is s root
    Create table t1 (id number primary key, id2 number);
    Create table t2(id number references t1(id) on delete cascade, id2 number);
    create table t3 (id number references t2(id)); -- Missing on delete cascade
    insert into t1 as select level, level from dual connect by level < 20;
    insert into t2 as select level, level from dual connect by level < 20;
    insert into t3 as select level from dual connect by level < 20;
    exec dbms_errlog(t1);
    exec dbms_errlog(t2);
    exec dbms_errlog(t3);
    delete from t1 where id = 1 log errors into err$_t1 reject limit unlimited;   -- Child record found violation due to t3 raised but I am expecting this error will be trapped in log tables.
    delete from t2 where id =1 log errors into err$_t2 reject limit unlimited; -- Got the same error child record violation. My expectation error will be logged into log tables.
    I am using Oracle 11gR2.
    Also, Please let me know if there is any restrictions to use DML error logging in DBMS_PARALLEL_EXECUTE.
    Please advise
    Thanks,
    Umakanth

    What is the error you want me to fix? Missing on delete cascade?
    The Code you posted has multiple syntax errors and can't possibly run. You should post code that actually works.
    My expectation is all the DML errors will be logged into error logging tables even if it is child record found violation.
    delete from t1 where id = 1 log errors into err$_t1 reject limit unlimited;  -- Child record found violation due to t3 raised but I am expecting this error will be trapped in log tables.
    delete from t2 where id =1 log errors into err$_t2 reject limit unlimited; -- Got the same error child record violation. My expectation error will be logged into log tables.
    DML error logging logs DATA. When you delete from T1 there is an error because the T2 child record can NOT be deleted. So the T1 row that was being deleted is logged into the T1 error log table. The request was to delete a T1 row so that is the only request that failed; the child rows in T2 and T3 will not be put into log tables.
    Same when you try to delete from T2. The T3 child record can NOT be deleted so the T2 row that was being deleted is logged into the T2 error log table.
    The exceptions that occur are NOT logged, only the data that the DML could not be performed on.
    After I fixed your code your example worked fine for me and logged into the DML error tables as expected. But I wasn't doing it from a client.

  • Dml error logging  - are exceptions redundant?

    Hi there
    Heard alot about dml error logging and looks good in practice.
    In a data warehouse environment and wish to make use of this in a pl/sql procedure - I'm thinking is the only exception I would neeed know something like
    when others
    then
    insert into error_table values(sqlcodes,sqlerrm);commit;
    raise;
    Another question as purely a background routine with no user interaction do we really need the raise - I know many posts talk about having ir or raise_application_error to alert user something went wrong but in purely batch procedures is this really necessary?
    Also what is the error_stack exactly and how can you query it?
    Any advice/thoughts?
    Many Thanks

    other question as purely a background routine with no
    user interaction do we really need the raise - I know
    many posts talk about having ir or
    raise_application_error to alert user something went
    wrong but in purely batch procedures is this really
    necessary?RAISE:
    there a discussion going on this issue:
    WHAT is the purpose of RAISE in an EXCEPTION clause ?
    RAISE_APPLICATION_ERROR
    this will report an error and will break out. Usually used to report errors while debugging.
    Regards

Maybe you are looking for

  • Streaming video from macbook pro to apple tv

    Hello, I understand that you can use airdisplay to stream the whole desktop view to the apple tv. However, I've found that its extremely laggy when I play videos that way. When I do, the video and sound is always off by a second. When I stream using

  • Using Edit in, LR3 wont open images in PSE9

    Hello,  I'm traveling right now and so not in my natural environment, dont have full resources.  I'm using my Mac Book Pro and doing some light editing.  I can not, however, get Lr3 and PSE9 to play nice together though.  If in Lr3 I request <Edit in

  • How to connect to an add-hoc

    hi there, i am using an i-phone 4s which is connected to wifi throough a PC add hoc, it was working fine with the IOS 5.1.1 but after upgrading to IOS 6 i could no longer connect it any more, meanwhile it is working fine with my home wifi network and

  • ACR settings help-recovery

    I am currently using ACR 7.4.  The recovery slide did not show up.  Customer Service told me to switch to 2012 in my settings.  They also told me-sort of rudely-that this is a question for the forum-um yeah-I'm new to this....so anyway-I don't even k

  • Safari redirect hijack - may have iOS5 virus or trojan

    This morning, while clicking on a link on a website, I was redirected to a **** site. Not so unusual, eh? Except this was on my iPhone 4s, running iOS 5 and Safari, and the same link is good on my Mac desktops. Clearing data, history, caches, and a r