Raise Exception for Insert Statement

Hello All,
Hope everyone know that when we try to do an Insert on a table in two different session with the same unique key then in the second session the application will hang.
Instead of hanging or waiting in another session, do we have any option to raise an Exception saying "Parallel Duplicate insertion is active." or to do Insert with NOWAIT so that it throws an Error.
Thanks in advance.
Regards,
Yathish

As far as I know, you cannot do this for inserts. It makes sense when you think about it a bit. User 1 inserts a row into the table but does not commit. That row only potentially exists in the database. User 2 comes along and tries to insert the same row. Oracle sees that this row potentially exists, so makes user 2 wait to see what user 1 does. If user 1 commits, user 2 will get a constraint violation, if user 1 does a rollback, then user 2 gets to insert their version of the row.
The only thing you can do is to catche the exception and then do whatever makes sense form a business perspective.
I have several cases where I use this kind of logic. I get messages coming in from several differrnt source systems. I potentially need to create records in a number of different tables. In some cases, while one session is processing a message, another session will process a different message that creates one of the objects that session 1 thinks it will need to. When session 1 gets the constraint violoation it either retrieves the newly created surrogate key for further use (i.e. in other child tables), or updates the newly created record with the data it hase, depending on the business rules in force.
John

Similar Messages

  • TAF creation for insert statement

    Hi,
    I created a TAF service for select statement but,
    I have a problem in creating a TAF service for INSERT statement.
    Can any one say how to create TAF for inserting?
    Hope i'll get my answer ASAP.
    Regards,
    Suri.

    Hi,
    DML is not supported by TAF. The application code must be prepared for these failures events.
    Regards,
    Rodrigo Mufalani
    http;//mufalani.blogspot.com

  • Nologging for insert statement

    Hello,
    Is it possible to use NOLOGGING with INSERT statement?
    For example:
    INSERT /*+ APPEND PARALLEL(test,4)*/INTO test NOLOGGING (select .....)
    It will take NOLOGGING as alias name of table or what is correct way to use NOLOGGING for insert statement.

    There is no such thing as a NOLOGGING hint (or insert keyword as you've tried it).
    You must use ALTER TABLE table_name NOLOGGING;

  • Request Forum inputs for Insert statements

    Hi All,
    I have a scenario as mentioned below and need your inputs to improve performance
    Package Sample
    Procedure A
    Insert into Table A();
    End Procedure A
    Procedure B
    Insert into Table B();
    End Procedure B
    Procedure C
    Insert into Table C();
    End Procedure C
    End Package Sample
    I assume that when I execute the above package completely, then first Procedure A starts to insert a million records followed by Procedure B and then C in a sequence.
    Is there any way through which while procedure A is executing, I need to parallely run the Procedure B and similarly Procedure C...
    Please advice on best way to achieve performance in the above mentioned scenario.....Thanks

    Harinath Arasu wrote:
    I assume that when I execute the above package completely, then first Procedure A starts to insert a million records followed by Procedure B and then C in a sequence.Wrong assumption. You don't execute packages. Packages are just collections of procedures/functions etc. that you call individually as you need. A package can have it's own execution section (BEGIN .... ) just before the END of the package, and that will execute once only, the first time the package is accessed for any one session (or if the package is invalidated and recompiled).
    Is there any way through which while procedure A is executing, I need to parallely run the Procedure B and similarly Procedure C...You need to use the DBMS_SCHEDULER package to schedule seperate jobs to run at the same time to call each of the procedures individually.
    Please advice on best way to achieve performance in the above mentioned scenario.....ThanksIf it's a performance issue, it's likely not just about getting them to run at the same time, but about what it's actually doing. So first you need to identify the cause of the performance issue.
    e.g. are your inserts all being doing in cursor loops? Or millions of insert statements? This is notoriously slow.
    Also read the threads pointed to by the following post:
    {message:id=9360003}

  • Exception in Insert Statement

    Hi folks,
    I am trying to insert into a sql-server table within my java code:
    affectedRows=stmt.executeUpdate("INSERT INTO smsdss.RptJobBypassObj (TrgTable,BypassObjId,PassSeqNo,ErrBusStrDate,CharmNo,EVTS,RsnText,RslvDate,UserId) " +
    "VALUES(" trgTabl ",'" + bypassObjI + ",'"+ passSeqN+ ",'"+ errStD + ",'"+ charmN + ",'"+ evt + ",'"+ reaso + ",'"+ errEndD + ",'"+ userI +"')");
    I am getting the following exception message.
    SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The name 'RaceDim' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
    'RaceDim' is the value of the variable trgTabl
    Thanks in advance.
    Have a nice day..

    your sql is obviously wrong. looks like you didn't put quotes around that string.
    print out the value of the query string and give it a look.
    you'd be much better off if you'd use PreparedStatement. Escaping strings and dates yourself is an error waiting to happen - like the one you've made.
    %

  • What's the syntax for Insert statement in Servlet?

    I'm trying to insert record into table using servlet. Can you please show me the statement and syntax of how to use it?

    hi
    we can insert in 2 types
    1) to all column insert
    insert into <tablename> values  ( 1,2,3,4...n);
    2) particular column insert
    insert into <tablename> ( col1,col2,col3...n)  values  ( value1 for col1, 2 , 3...n);
    ex:
              PreparedStatement ps = con.prepareStatement ( "insert into billtable (grandtotal,userid,creditno)values( ?,?,? )" );
              //bill table
              ps.setDouble ( 1, 10.50);  //replace this double value with double variable
              ps.setString ( 2, "vijay");
              ps.setLong      ( 3, 1111111111);  
              ps.executeUpdate ();
              ps.clearParameters ();
              ps.close ();More Details refer java with Jdbc concepts

  • Raising exception for LONG variable

    Hi
    I am calling a procedure from HTML which passes data into a LONG
    type variable. If the length of data is more than 32KB , NULL is
    assigned to the LONG variable and no error is raised. Is there
    any way this exception can be trapped ? Any info in this regard
    will be much appreciated.
    Sharon
    null

    Solomon Yakobson wrote:
    Jiri in SF wrote:
    I would say right before you query the data from dblink, use DBMS_APPLICATION_INFO to set module or/and action for that session, then have a separate job scheduled every 5? minutes to scan for sessions with your module/action (it can be really any static text you want BLABLABLA works - the point is that you can easily identify these sessions) which hang for more than 2? minutes and send email or kill these sessionsWell, although it would give you geat level of flexibility, it would mean rewriting code and results in some overhead. Also, it would kill distributed transactions running for longer than set time, not distributed transactions waiting for locked resources longer than set time. To kill distributed transaction waiting for a locked resource more then a set time (as OP requested) OP could set initialization parameter DISTRIBUTED_LOCK_TIMEOUT to desired value. Obviously, same timeout will apply to all distributed queries, unfortunately, DISTRIBUTED_LOCK_TIMEOUT is not dynamic parameter
    SY.not sure what his issue is (maybe different from what we were facing), but our was not related to locking, it was basically hanging session. Remote server did not even see the session being connected yet it was hanging for hours on query across db-link. It was very rare - the session ran daily and hang maybe once a 6 months. In our case we just wanted to be informed that it hang, so production support could follow up on the issue.

  • Invalid payload for insert statement of a DB adapter

    Hi,
    I am back again with another issue :-(
    I have build a BPEL process which is reading data from a flat file (fixed fieldlength) using the ftp adapter. Next I pass this data to an ESB service, which will do some work on the data (including a normalize-space) and should finally write it to the DB. Unfortunately the insert fails due to empty elements in the xml.
    <top:TblScprl4VorgangCollection xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/WriteOrderVorgang2Interface">
       <top:TblScprl4Vorgang>
          <top:sidKomm>71540000021754168</top:sidKomm>
          <top:atlasversionsnummer>E.2.0</top:atlasversionsnummer>
          <top:anmeldeart>ESV</top:anmeldeart>
          <top:beladeort/>
          <top:anzContainerGesamt/>
          <top:vorpapierNr/>
          <top:vorpapierart>OHNE</top:vorpapierart>
       </top:TblScprl4Vorgang>
    </top:TblScprl4VorgangCollection>I must admit that these elements are a result of the fixed fieldlength and using normalize-space, but why is the DB adapter unable to handle these empty elements? It's driving me nuts! Especially because using the DB adapter in a BPEL process has no problem to write such data :-(
    For the reason of performance I wanted to give the ESB a try. Now I'm stuck.
    Could this be a bug in SOA Suite 10.1.3.3.0? Are there any workarounds?
    Any ideas welcome.
    Regards
    Marco

    Hi all,
    just another update.
    I found out that using *<xsl:if test="string-length(...) > 0">* in the mapper file of the ESB process' routing rule, it filters out the empty elements. So although this will do as a workaround, I am wondering if this is the only possibility to get a valid payload. (I can't wait for the first performance test ;-) )
    So, if someone is able to come up with a better solution, please let me know!
    Kind regards,
    Marco

  • Error in insert statement

    hi,
    i have used script for insert statement.while compiling it ,it shows error in declare section that to in t24_customer_code.can any body pls check out and tell me.
    the script is ....
    DECLARE
    a NUMBER := 10;
    t24_customer_code NUMBER;
    my_tab SYS.dbms_debug_vc2coll := SYS.dbms_debug_vc2coll ();
    BEGIN
    LOOP
    EXIT WHEN a > 20;
    a := a + 1;
    t24_customer_code:= 9700 + a;
    INSERT INTO t24_customer
    (t24_customer_code,
                   T24_MNEMONIC,
                   T24_SHORT_NAME,
                   T24_NAME_1,
                   T24_NAME_2,
                   T24_STREET,
                   T24_SECTOR,
                   T24_ACCOUNT_OFFICER,
                   T24_OTHER_OFFICER,
                   T24_INDUSTRY,
                   T24_TARGET,
                   T24_NATIONALITY,
                   T24_CUSTOMER_STATUS,
                   T24_LANGUAGE)
    VALUES
                   (t24_customer_code,
         'MNEMON' || a,
         'HANSARUN',
         'KUMAR',
         'MAQSOOD',
         'NIYAZ DINESH',
         1001,
                   1,
         5,
                   1000,
                   1,
                   'US',
                   2,
                   'US');
    my_tab.EXTEND;
    my_tab (a - 1) := t24_customer_code;
    END LOOP;
    OPEN :cur FOR
    SELECT *
    FROM t24_customer
    WHERE t24_customer_code IN (SELECT COLUMN_VALUE
    FROM TABLE (CAST (my_tab AS SYS.dbms_debug_vc2coll)));
    END;
    thanks
    ratheesh

    Please describe column name and data type on your table.
    T24_MNEMONIC is not NUMBER, is it?
    By the way,
    VALUES
    (t24_customer_code,Here t24_customer_code is not your variable
    but that is column name of t24_customer.
    You might get another error after solving 'ORA-01722: invalid number'
    SQL> edit
    Wrote file afiedt.buf
      1* insert into scott.dept (deptno) values (deptno)
    SQL> /
    insert into scott.dept (deptno) values (deptno)
    ERROR at line 1:
    ORA-00984: column not allowed here

  • Insert statement taking more time

    Hi,
    Insert happening very slow after sqlldr happening in my program. Please find the below workflow of my program.
    1) SQLLDR will be called, it will insert around 4 lakhs records in 'TEMP" table using direct path load.Response time is good here.
    2)After, SQLLDR has finished its job, my procedure will be called, there every cursor statement working fine, but when it comes for "INSERT" statement it takes almost 40 mins.
    3)Insert statement like this
    INSERT /*+ append */ INTO HISTORY_TABLE(<COLUMN1>,<COLUMN2>,..etc) SELECT (<COLUMN1>,.<COLUMN2>...etc) from TEMP_TABLE;
    4)select records from temp table which records were inserted during sqlldr(direct=true),before procedure call.
    5)I check explain plan for the Insert statement it shows conventional path loading
    | Id  | Operation                | Name             | Rows  | Bytes | Cost (%CPU)|
    |   0 | INSERT STATEMENT         |                  |   409K|   143M|  6752   (2)|
    |   1 |  LOAD AS SELECT          | HISTORY_TABLE    |       |       |            |
    |   2 |   TABLE ACCESS FULL      | TEMP_TABLE       |   409K|   143M|  6752   (2)|
    6)Since i have no where condition in my insert statement it go for an full table scan.
    Kindly advice to impove its performance.
    My db is oracle 11g r2(11.2.0.3.0)
    OS-Windows server 2008 r2
    Tkprof for the sesion:
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1     98.10    1860.58     347770      74736    1711253      407077
    Fetch        0      0.00       0.00          0          0          0           0
    total        1     98.10    1860.58     347770      74736    1711253      407077
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 84     (recursive depth: 1)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                    256304        6.61       1299.01
      direct path read temp                         273        3.47         14.99
      log buffer space                               22        0.75          3.84
      log file switch completion                      7       19.48         30.70
      log file switch (checkpoint incomplete)        16        8.12         17.15
      db file parallel read                           2        0.07          0.09
      log file switch (private strand flush incomplete)
                                                      3        0.32          0.74
      buffer busy waits                               4        0.00          0.00
      undo segment extension                          2        0.00          0.00
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      11.2.0.3
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    optimizer_use_invisible_indexes      boolean     FALSE
    optimizer_use_pending_statistics     boolean     FALSE
    optimizer_use_sql_plan_baselines     boolean     TRUE
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     128
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>
    SQL> l
      1  select
      2* sname,pname,pval1,pval2 from sys.aux_stats$
    SQL> /
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          11-03-2011 06:38
    SYSSTATS_INFO        DSTOP                           11-03-2011 06:38
    SYSSTATS_INFO        FLAGS                         1
    SYSSTATS_MAIN        CPUSPEEDNW           1720.20725
    SYSSTATS_MAIN        IOSEEKTIM                    10
    SYSSTATS_MAIN        IOTFRSPEED                 4096
    SYSSTATS_MAIN        SREADTIM
    SYSSTATS_MAIN        MREADTIM
    SYSSTATS_MAIN        CPUSPEED
    SYSSTATS_MAIN        MBRC
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_MAIN        MAXTHR
    SYSSTATS_MAIN        SLAVETHR
    Thanks
    Faiz

    Hi,
    Below i apend the both table definitions. Please check
    CREATE TABLE HISTORY_TABLE
       ( DAT_TIM VARCHAR2(19 BYTE),
    REC_TYP VARCHAR2(2 BYTE),
    AUTH_PPD VARCHAR2(4 BYTE),
    LN_TERM VARCHAR2(4 BYTE),
    FIID_TERM VARCHAR2(4 BYTE),
    TERM_ID VARCHAR2(16 BYTE),
    LN_ISSUER VARCHAR2(4 BYTE),
    FIID_ISSUER VARCHAR2(20 BYTE),
    PAN VARCHAR2(19 BYTE),
    MBR_NUM VARCHAR2(3 BYTE),
    BRCH_ID VARCHAR2(4 BYTE),
    REGN_ID VARCHAR2(4 BYTE),
    USER_FLD1X VARCHAR2(2 BYTE),
    TYP_CDE VARCHAR2(2 BYTE),
    TYP VARCHAR2(4 BYTE),
    RTE_STAT VARCHAR2(2 BYTE),
    ORIGINATOR CHAR(1 BYTE),
    RESPONDER CHAR(1 BYTE),
    ENTRY_TIM VARCHAR2(19 BYTE),
    EXIT_TIM VARCHAR2(19 BYTE),
    RE_ENTRY_TIM VARCHAR2(19 BYTE),
    TRAN_DAT VARCHAR2(6 BYTE),
    TRAN_TIM VARCHAR2(8 BYTE),
    POST_DAT VARCHAR2(6 BYTE),
    ACQ_ICHG_SETL_DAT VARCHAR2(6 BYTE),
    ISS_ICHG_SETL_DAT VARCHAR2(6 BYTE),
    SEQ_NUM VARCHAR2(12 BYTE),
    TERM_TYP VARCHAR2(2 BYTE),
    TIM_OFST VARCHAR2(5 BYTE),
    ACQ_INST_ID_NUM VARCHAR2(11 BYTE),
    RCV_INST_ID_NUM VARCHAR2(11 BYTE),
    T_CDE VARCHAR2(2 BYTE),
    T_FROM VARCHAR2(2 BYTE),
    T_TO VARCHAR2(2 BYTE),
    FROM_ACCT VARCHAR2(24 BYTE),
    USER_FLD1 VARCHAR2(1 BYTE),
    TO_ACCT VARCHAR2(19 BYTE),
    MULT_ACCT VARCHAR2(1 BYTE),
    AMT1 VARCHAR2(19 BYTE),
    AMT2 VARCHAR2(19 BYTE),
    AMT3 VARCHAR2(19 BYTE),
    DEP_BAL_CR VARCHAR2(10 BYTE),
    DEP_TYP VARCHAR2(1 BYTE),
    RESP_BYTE1 VARCHAR2(3 BYTE),
    RESP_BYTE2 VARCHAR2(3 BYTE),
    TERM_NAME_LOC VARCHAR2(25 BYTE),
    TERM_OWNER_NAME VARCHAR2(40 BYTE),
    TERM_CITY VARCHAR2(13 BYTE),
    TERM_ST_X VARCHAR2(3 BYTE),
    TERM_CNTRY_X VARCHAR2(2 BYTE),
    OSEQ_NUM VARCHAR2(12 BYTE),
    OTRAN_DAT VARCHAR2(4 BYTE),
    OTRAN_TIM VARCHAR2(8 BYTE),
    B24_POST_DAT VARCHAR2(4 BYTE),
    ORIG_CRNCY_CDE VARCHAR2(3 BYTE),
    AUTH_CRNCY_CDE VARCHAR2(3 BYTE),
    AUTH_CONV_RATE VARCHAR2(8 BYTE),
    SETL_CRNCY_CDE VARCHAR2(3 BYTE),
    SETL_CONV_RATE VARCHAR2(8 BYTE),
    CONV_DAT_TIM VARCHAR2(19 BYTE),
    RVSL_RSN VARCHAR2(2 BYTE),
    PIN_OFST VARCHAR2(16 BYTE),
    SHRG_GRP VARCHAR2(1 BYTE),
    DEST_ORDER VARCHAR2(1 BYTE),
    AUTH_ID_RESP VARCHAR2(6 BYTE),
    IMP_IND VARCHAR2(1 BYTE),
    AVAIL_IMP VARCHAR2(2 BYTE),
    LEDG_IMP VARCHAR2(2 BYTE),
    HLD_AMT_IMP VARCHAR2(2 BYTE),
    CAF_REFR_IND VARCHAR2(1 BYTE),
    USER_FLD3 VARCHAR2(1 BYTE),
    DEP_SETL_IMP_FLG VARCHAR2(1 BYTE),
    ADJ_SETL_IMP_FLG VARCHAR2(1 BYTE),
    PBF1 VARCHAR2(1 BYTE),
    PBF2 VARCHAR2(1 BYTE),
    PBF3 VARCHAR2(1 BYTE),
    PBF4 VARCHAR2(1 BYTE),
    USER_FLD4 VARCHAR2(16 BYTE),
    FRWD_INST_ID_NUM VARCHAR2(11 BYTE),
    CRD_ACCPT_ID_NUM VARCHAR2(40 BYTE),
    CRD_ISS_ID_NUM VARCHAR2(11 BYTE),
    USER_FLD6 VARCHAR2(1 BYTE),
    FILE_NAME VARCHAR2(100 BYTE),
    ERR_FLAG CHAR(1 BYTE),
    AMT2_ACTUAL VARCHAR2(20 BYTE),
    ID_COL NUMBER(23,0),
    RVSL_FLAG CHAR(1 BYTE),
    SWRE_ID VARCHAR2(20 BYTE),
    GAC_ID VARCHAR2(20 BYTE),
    INS_USER NUMBER(5,0),
    PART_CODE NUMBER(3,0),
    ISS_RECON NUMBER(1,0),
    ACQ_RECON NUMBER(1,0),
    CROSS_BRANCH CHAR(1 BYTE),
    CONSORTIUM_CODE NUMBER(3,0),
    FROM_HOST VARCHAR2(1 BYTE),
    FROM_HOST_ACQ VARCHAR2(1 BYTE),
    AUDIT_NUM VARCHAR2(12 BYTE),
    CAPTURE_CODE VARCHAR2(1 BYTE),
    RESP_DAT_TIME VARCHAR2(19 BYTE),
    PAN_SEQ_NUM NUMBER(1,0),
    SERVICE_CODE VARCHAR2(3 BYTE),
    ISS_BIN VARCHAR2(6 BYTE),
    POS_DATA VARCHAR2(12 BYTE),
    SECURITY_DATA VARCHAR2(8 BYTE),
    CASHBACK_AMT VARCHAR2(15 BYTE),
    REPLACEMENT_AMOUNT VARCHAR2(15 BYTE),
    SETTL_AMT VARCHAR2(16 BYTE),
    TRAN_FEE VARCHAR2(15 BYTE),
    SETL_FEE VARCHAR2(15 BYTE),
    MERC_CODE VARCHAR2(4 BYTE),
    NTWORK_DATA VARCHAR2(12 BYTE),
    PRIVATE_DATA_C_100 VARCHAR2(100 BYTE),
    PAYMENT_INFO VARCHAR2(50 BYTE),
    SURCHARGE_FEE VARCHAR2(15 BYTE),
    SURC_BILL_AMT VARCHAR2(19 BYTE),
    PROCESSING_CODE VARCHAR2(7 BYTE),
    FRWD_CNTRY_CODE VARCHAR2(3 BYTE),
    NTWORK_CODE VARCHAR2(2 BYTE),
    FUNCTION_CODE VARCHAR2(3 BYTE),
    REASON_CODE VARCHAR2(4 BYTE),
    FEES VARCHAR2(10 BYTE),
    SUR_CHARGE VARCHAR2(10 BYTE),
    MESSAGE_TYPE VARCHAR2(4 BYTE),
    APPROVE_STATUS VARCHAR2(10 BYTE),
    CPS_TRAN_ID VARCHAR2(20 BYTE),
    BANKTYPE_CODE VARCHAR2(5 BYTE),
    RRB_BIN_CODE VARCHAR2(7 BYTE),
    T_TYPE VARCHAR2(5 BYTE),
    FEE_CRNCY VARCHAR2(25 BYTE),
    FEE_INDICATOR VARCHAR2(1 BYTE),
    FEE_TYPE VARCHAR2(84 BYTE),
    CREDIT_BANK_CODE VARCHAR2(11 BYTE),
    CREDIT_BR_CODE VARCHAR2(8 BYTE),
    DEBIT_BANK_CODE VARCHAR2(11 BYTE),
    ACTION_CODE VARCHAR2(3 BYTE),
    ZEROS VARCHAR2(6 BYTE),
    OTRACE_AUDIT_NO VARCHAR2(6 BYTE),
    OFEE_TYPE1 VARCHAR2(2 BYTE),
    OFEE_CRNCY1 VARCHAR2(3 BYTE),
    OFEE_AMNT VARCHAR2(16 BYTE),
    OFEE_INDICATOR VARCHAR2(1 BYTE),
    SPACES VARCHAR2(2 BYTE),
    ACQ_BANK_CODE VARCHAR2(6 BYTE),
    CASHAT_POS VARCHAR2(16 BYTE),
    LTS_STATUS VARCHAR2(30 BYTE),
    APP_CODE VARCHAR2(6 BYTE),
    CARD_ACCEPTID VARCHAR2(15 BYTE),
    RESPONSE_CODE VARCHAR2(15 BYTE),
    RES_RECVD_HOST VARCHAR2(1 BYTE),
    DEVICE_ID VARCHAR2(16 BYTE),
    RECORD_TYPE VARCHAR2(1 BYTE),
    RRT_DEBIT_BANK_CODE VARCHAR2(11 BYTE),
    ORIG_TYP VARCHAR2(6 BYTE),
    DEVICE_TYPE VARCHAR2(3 BYTE),
    ORGTRAN_CODE VARCHAR2(4 BYTE),
    BILL_CRNCY VARCHAR2(3 BYTE),
    BILL_AMNT VARCHAR2(19 BYTE),
    OTRAN_AMNT VARCHAR2(19 BYTE),
    INS_DATE DATE,
    RECON_FLAG VARCHAR2(2 BYTE),
    TRAN_ID VARCHAR2(25 BYTE)
       ) SEGMENT CREATION IMMEDIATE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_TST ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX ON HISTORY_TABLE (TYP, DEVICE_ID, FROM_ACCT, AMT1, NTWORK_CODE, ISS_BIN, POST_DAT, RESP_BYTE1, DEVICE_TYPE, T_CDE, PRIVATE_DATA_C_100, REASON_CODE)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX1 ON HISTORY_TABLE (TO_NUMBER(AMT1))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX_FN ON HISTORY_TABLE (SUBSTR(DEVICE_ID,4))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX_IDX ON HISTORY_TABLE (T_CDE, PRIVATE_DATA_C_100, ISS_BIN)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX_TST ON HISTORY_TABLE (TYP, POST_DAT, RESP_BYTE1, DEVICE_TYPE, AMT1)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_ALL_SWT_DATA_INDEX_TST1 ON HISTORY_TABLE (DEVICE_TYPE, TO_NUMBER(AMT1))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IDX_ALLSWT_PAN ON HISTORY_TABLE (PAN)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
    Table Definition for TEMP Table:
    CREATE TABLE REC_TLF_TEMP
       ( DAT_TIM VARCHAR2(19 BYTE),
    REC_TYP VARCHAR2(2 BYTE),
    AUTH_PPD VARCHAR2(4 BYTE),
    LN_TERM VARCHAR2(4 BYTE),
    FIID_TERM VARCHAR2(4 BYTE),
    TERM_ID VARCHAR2(16 BYTE),
    LN_ISSUER VARCHAR2(4 BYTE),
    FIID_ISSUER VARCHAR2(20 BYTE),
    PAN VARCHAR2(19 BYTE),
    MBR_NUM VARCHAR2(3 BYTE),
    BRCH_ID VARCHAR2(4 BYTE),
    REGN_ID VARCHAR2(4 BYTE),
    USER_FLD1X VARCHAR2(2 BYTE),
    TYP_CDE VARCHAR2(2 BYTE),
    TYP VARCHAR2(4 BYTE),
    RTE_STAT VARCHAR2(2 BYTE),
    ORIGINATOR CHAR(1 BYTE),
    RESPONDER CHAR(1 BYTE),
    ENTRY_TIM VARCHAR2(19 BYTE),
    EXIT_TIM VARCHAR2(19 BYTE),
    RE_ENTRY_TIM VARCHAR2(19 BYTE),
    TRAN_DAT VARCHAR2(6 BYTE),
    TRAN_TIM VARCHAR2(8 BYTE),
    POST_DAT VARCHAR2(6 BYTE),
    ACQ_ICHG_SETL_DAT VARCHAR2(6 BYTE),
    ISS_ICHG_SETL_DAT VARCHAR2(6 BYTE),
    SEQ_NUM VARCHAR2(12 BYTE),
    TERM_TYP VARCHAR2(2 BYTE),
    TIM_OFST VARCHAR2(5 BYTE),
    ACQ_INST_ID_NUM VARCHAR2(11 BYTE),
    RCV_INST_ID_NUM VARCHAR2(11 BYTE),
    T_CDE VARCHAR2(2 BYTE),
    T_FROM VARCHAR2(2 BYTE),
    T_TO VARCHAR2(2 BYTE),
    FROM_ACCT VARCHAR2(24 BYTE),
    USER_FLD1 VARCHAR2(1 BYTE),
    TO_ACCT VARCHAR2(19 BYTE),
    MULT_ACCT VARCHAR2(1 BYTE),
    AMT1 VARCHAR2(19 BYTE),
    AMT2 VARCHAR2(19 BYTE),
    AMT3 VARCHAR2(19 BYTE),
    DEP_BAL_CR VARCHAR2(10 BYTE),
    DEP_TYP VARCHAR2(1 BYTE),
    RESP_BYTE1 VARCHAR2(3 BYTE),
    RESP_BYTE2 VARCHAR2(3 BYTE),
    TERM_NAME_LOC VARCHAR2(25 BYTE),
    TERM_OWNER_NAME VARCHAR2(40 BYTE),
    TERM_CITY VARCHAR2(13 BYTE),
    TERM_ST_X VARCHAR2(3 BYTE),
    TERM_CNTRY_X VARCHAR2(2 BYTE),
    OSEQ_NUM VARCHAR2(12 BYTE),
    OTRAN_DAT VARCHAR2(4 BYTE),
    OTRAN_TIM VARCHAR2(8 BYTE),
    B24_POST_DAT VARCHAR2(4 BYTE),
    ORIG_CRNCY_CDE VARCHAR2(3 BYTE),
    AUTH_CRNCY_CDE VARCHAR2(3 BYTE),
    AUTH_CONV_RATE VARCHAR2(8 BYTE),
    SETL_CRNCY_CDE VARCHAR2(3 BYTE),
    SETL_CONV_RATE VARCHAR2(8 BYTE),
    CONV_DAT_TIM VARCHAR2(19 BYTE),
    RVSL_RSN VARCHAR2(2 BYTE),
    PIN_OFST VARCHAR2(16 BYTE),
    SHRG_GRP VARCHAR2(1 BYTE),
    DEST_ORDER VARCHAR2(1 BYTE),
    AUTH_ID_RESP VARCHAR2(6 BYTE),
    IMP_IND VARCHAR2(1 BYTE),
    AVAIL_IMP VARCHAR2(2 BYTE),
    LEDG_IMP VARCHAR2(2 BYTE),
    HLD_AMT_IMP VARCHAR2(2 BYTE),
    CAF_REFR_IND VARCHAR2(1 BYTE),
    USER_FLD3 VARCHAR2(1 BYTE),
    DEP_SETL_IMP_FLG VARCHAR2(1 BYTE),
    ADJ_SETL_IMP_FLG VARCHAR2(1 BYTE),
    PBF1 VARCHAR2(1 BYTE),
    PBF2 VARCHAR2(1 BYTE),
    PBF3 VARCHAR2(1 BYTE),
    PBF4 VARCHAR2(1 BYTE),
    USER_FLD4 VARCHAR2(16 BYTE),
    FRWD_INST_ID_NUM VARCHAR2(11 BYTE),
    CRD_ACCPT_ID_NUM VARCHAR2(40 BYTE),
    CRD_ISS_ID_NUM VARCHAR2(11 BYTE),
    USER_FLD6 VARCHAR2(1 BYTE),
    FILE_NAME VARCHAR2(100 BYTE),
    ERR_FLAG CHAR(1 BYTE),
    AMT2_ACTUAL VARCHAR2(20 BYTE),
    ID_COL NUMBER(23,0),
    RVSL_FLAG CHAR(1 BYTE),
    SWRE_ID VARCHAR2(20 BYTE),
    GAC_ID VARCHAR2(20 BYTE),
    INS_USER NUMBER(5,0),
    PART_CODE NUMBER(3,0),
    ISS_RECON NUMBER(1,0),
    ACQ_RECON NUMBER(1,0),
    CROSS_BRANCH CHAR(1 BYTE),
    CONSORTIUM_CODE NUMBER(3,0),
    FROM_HOST VARCHAR2(1 BYTE),
    FROM_HOST_ACQ VARCHAR2(1 BYTE),
    AUDIT_NUM VARCHAR2(12 BYTE),
    CAPTURE_CODE VARCHAR2(1 BYTE),
    RESP_DAT_TIME VARCHAR2(19 BYTE),
    PAN_SEQ_NUM NUMBER(1,0),
    SERVICE_CODE VARCHAR2(3 BYTE),
    ISS_BIN VARCHAR2(6 BYTE),
    POS_DATA VARCHAR2(12 BYTE),
    SECURITY_DATA VARCHAR2(8 BYTE),
    CASHBACK_AMT VARCHAR2(15 BYTE),
    REPLACEMENT_AMOUNT VARCHAR2(15 BYTE),
    SETTL_AMT VARCHAR2(16 BYTE),
    TRAN_FEE VARCHAR2(15 BYTE),
    SETL_FEE VARCHAR2(15 BYTE),
    MERC_CODE VARCHAR2(4 BYTE),
    NTWORK_DATA VARCHAR2(12 BYTE),
    PRIVATE_DATA_C_100 VARCHAR2(100 BYTE),
    PAYMENT_INFO VARCHAR2(50 BYTE),
    SURCHARGE_FEE VARCHAR2(15 BYTE),
    SURC_BILL_AMT VARCHAR2(19 BYTE),
    PROCESSING_CODE VARCHAR2(7 BYTE),
    FRWD_CNTRY_CODE VARCHAR2(3 BYTE),
    NTWORK_CODE VARCHAR2(2 BYTE),
    FUNCTION_CODE VARCHAR2(3 BYTE),
    REASON_CODE VARCHAR2(4 BYTE),
    FEES VARCHAR2(10 BYTE),
    SUR_CHARGE VARCHAR2(10 BYTE),
    MESSAGE_TYPE VARCHAR2(4 BYTE),
    APPROVE_STATUS VARCHAR2(10 BYTE),
    CPS_TRAN_ID VARCHAR2(20 BYTE),
    BANKTYPE_CODE VARCHAR2(5 BYTE),
    RRB_BIN_CODE VARCHAR2(7 BYTE),
    T_TYPE VARCHAR2(5 BYTE),
    FEE_CRNCY VARCHAR2(25 BYTE),
    FEE_INDICATOR VARCHAR2(1 BYTE),
    FEE_TYPE VARCHAR2(84 BYTE),
    CREDIT_BANK_CODE VARCHAR2(11 BYTE),
    CREDIT_BR_CODE VARCHAR2(8 BYTE),
    DEBIT_BANK_CODE VARCHAR2(11 BYTE),
    ACTION_CODE VARCHAR2(3 BYTE),
    ZEROS VARCHAR2(6 BYTE),
    OTRACE_AUDIT_NO VARCHAR2(6 BYTE),
    OFEE_TYPE1 VARCHAR2(2 BYTE),
    OFEE_CRNCY1 VARCHAR2(3 BYTE),
    OFEE_AMNT VARCHAR2(16 BYTE),
    OFEE_INDICATOR VARCHAR2(1 BYTE),
    SPACES VARCHAR2(2 BYTE),
    ACQ_BANK_CODE VARCHAR2(6 BYTE),
    CASHAT_POS VARCHAR2(16 BYTE),
    LTS_STATUS VARCHAR2(30 BYTE),
    APP_CODE VARCHAR2(6 BYTE),
    CARD_ACCEPTID VARCHAR2(15 BYTE),
    RESPONSE_CODE VARCHAR2(15 BYTE),
    RES_RECVD_HOST VARCHAR2(1 BYTE),
    DEVICE_ID VARCHAR2(16 BYTE),
    RECORD_TYPE VARCHAR2(1 BYTE),
    RRT_DEBIT_BANK_CODE VARCHAR2(11 BYTE),
    ORIG_TYP VARCHAR2(6 BYTE),
    DEVICE_TYPE VARCHAR2(3 BYTE),
    ORGTRAN_CODE VARCHAR2(4 BYTE),
    BILL_CRNCY VARCHAR2(3 BYTE),
    TRAN_ID VARCHAR2(25 BYTE),
    RECON_FLAG VARCHAR2(2 BYTE),
    BILL_AMNT VARCHAR2(19 BYTE),
    OTRAN_AMNT VARCHAR2(19 BYTE),
    INS_DATE DATE
       ) SEGMENT CREATION IMMEDIATE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_TST ;
      CREATE INDEX CMS_TLF_TEMP_INDEX3 ON REC_TLF_TEMP (TO_NUMBER(PAN))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX CMS_TLF_TEMP_INDEX4 ON REC_TLF_TEMP (TO_NUMBER(AUDIT_NUM))
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IDX_REC_TEMP_CDE ON REC_TLF_TEMP (T_CDE)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_TST ;
      CREATE INDEX IDX_TLF_DEVICEID ON REC_TLF_TEMP (DEVICE_ID)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IDX_TLF_PRIVATE ON REC_TLF_TEMP (PRIVATE_DATA_C_100)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_TST ;
      CREATE INDEX IDX_TLF_TEMP_BYTE1 ON REC_TLF_TEMP (PRIVATE_DATA_C_100, ISS_BIN, NTWORK_CODE)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_TST ;
      CREATE INDEX IDX_TLF_TEMP_TST ON REC_TLF_TEMP (RESP_BYTE1)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IND_TLFTEMP_RVSLFLG ON REC_TLF_TEMP (RVSL_FLAG)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IND_TLFTEMP_TRMID_TCD ON REC_TLF_TEMP (TERM_ID, T_CDE)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX IND_TLFTMP_NWCDE ON REC_TLF_TEMP (NTWORK_CODE)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX REC_TLF_TEMP_INDEX ON REC_TLF_TEMP (PAN, SEQ_NUM, AUDIT_NUM)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
      CREATE INDEX TEMPREVLSET ON REC_TLF_TEMP (SEQ_NUM, TYP, REC_TYP, PAN)
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE TBS_IDX ;
    It shows that no triggers for both the tables.
    Confirm that no where condition being used in the SQL.
    Thanks
    Faiz

  • Raise exception using CX_MAPPING_FAULT

    Hi,
    I want to raise an exception when an error occured in the ABAP mapping.I can be able to raise single message exception using the above one but I want to raise exception for all the messages from an error message internal table.I collect return codes and error messages into an internal table and want to display them in SXMB_MONI. Is it possible to raise multiple exceptions using CX_MAPPING_FAULT.
    Thanks,
    RP

    Hi,
    Refer,
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    http://srikanth4xi.blogspot.com/
    "Award points if helpful"
    Regards,
    Jayasimha Jangam

  • Workbench manager raising exception

    I am converting Sybase 11.9 to Oracle 8.1.7.
    While creating Oracle Model, the tool is raising exception for mapping user privileges. The exception is :
    Sybase Source ModelMAP._MAPuserprivileges():1,invalid column index().
    Any pointers as to how to fix this ?
    Thx
    Seema

    Please e-mail
    [email protected] Please include the %ORACLE_HOME%\omwb\log\error.log file
    It may be a bug or you may just need to re-create your repository.

  • Exceptions raised by Insert statement

    In procedure insert statement raising value_error,invalid_error. so how to capture this errors?
    code:
    insert into table_name values(....);
    exception
    when ?

    Hi,
    You must change NULL statements for appropiate statements. For more information please check [Summary of Predefined PL/SQL Exceptions|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/errors.htm#sthref1966]
    BEGIN
        INSERT INTO table_name
        VALUES
    EXCEPTION
        WHEN INVALID_NUMBER THEN
            NULL;
        WHEN DUP_VAL_ON_INDEX THEN
            NULL;
        WHEN OTHERS THEN
            NULL;
    END;
    /Regards,

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

  • Bulk Load question for an insert statement.

    I'm looking to put the following statement into a FORALL statement using BULK COLLLECT and I need some guidance.
    Am I going to be putting the SELECT statement into a cursor and then load the cursor values into a defined Nested Table type defined variable?
    INSERT INTO TEMP_ASSOC_CURRENT_WEEK_IDS
    SELECT aor.associate_office_record_id ,
    sched.get_assoc_sched_rotation_week(aor.associate_office_record_id, v_weekType.start_date) week_id
    FROM ASSOCIATE_OFFICE_RECORDS aor
    WHERE aor.OFFICE_ID = v_office_id
    AND (
    (aor.lt_assoc_stage_result_id in (4,8)
    AND v_officeWeekType.start_date >= trunc(aor.schedule_start_date)
    OR aor.lt_assoc_stage_result_id in (1, 2)
    ));

    I see people are reading this so for the insanely curious here's how I did it.
    Type AOR_REC is RECORD(
    associate_office_record_id dbms_sql.number_table,
    week_id dbms_sql.number_table); --RJS.***Setting up Type for use with Bulk Collect FORALL statements.
    v_a_rec AOR_REC; -- RJS. *** defining variable of defined Type to use with Bulk Collect FORALL statements.
    CURSOR cur_aor_ids -- RJS *** Cursor for BULK COLLECT.
    IS
    SELECT aor.associate_office_record_id associate_office_record_id,
    sched.get_assoc_sched_rotation_week(aor.associate_office_record_id, v_weekType.start_date) week_id
    FROM ASSOCIATE_OFFICE_RECORDS aor
    WHERE aor.OFFICE_ID = v_office_id
    AND (
    (aor.lt_assoc_stage_result_id in (4,8)
    AND v_officeWeekType.start_date >= trunc(aor.schedule_start_date)
    OR aor.lt_assoc_stage_result_id in (1, 2)
    FOR UPDATE NOWAIT;
    BEGIN
    BEGIN
    OPEN cur_aor_ids;
    LOOP
    FETCH cur_aor_ids BULK COLLECT into
    v_a_rec.associate_office_record_id, v_a_rec.week_id; --RJS. *** Bulk Load your cursor data into a buffer to do the Delete all at once.
    FORALL i IN 1..v_a_rec.associate_office_record_id.COUNT SAVE EXCEPTIONS
    INSERT INTO TEMP_ASSOC_CURRENT_WEEK_IDS
    (associate_office_record_id,week_id)
    VALUES
    (v_a_rec.associate_office_record_id(i), v_a_rec.week_id(i)); --RJS. *** Single FORALL BULK DELETE statement.
    EXIT WHEN cur_aor_ids%NOTFOUND;
    END LOOP;
    CLOSE cur_aor_ids;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR ENCOUNTERED IS SQLCODE = '|| SQLCODE ||' AND SQLERRM = ' || SQLERRM);
    dbms_output.put_line('Number of INSERT statements that
    failed: ' || SQL%BULK_EXCEPTIONS.COUNT);
    End;
    Easy right?

Maybe you are looking for

  • External monitor preview

    I have heard that you need firewire to preview on a another monitor (after effects). where do i plug the wires? usb part in the computer and the firewire part in the monitor? <moved by mod from downloading,installing,setting up - kglad>

  • Is there any method to export the data from oracle 10g in any format !!!!!

    is there any methods to export the data from oracle 10g in the format of excel or csc or txt or anyother. i already downloaded the sql developer tool but it only exports the data of upto one lakh rows ,but i have two tables of more than 3 lakh and 10

  • Can't get safari to talk to any web site except mobileme on winxp

    Safari 3.1.2 for first time on Windows XP looks like it's not getting out to net. "Safari could not open the page "http://www.apple.com/" because the server is not responding." for all sites except to MobileMe login ("auth.apple.com..." with an HTTPS

  • R/3 is  locking when BW loads triggers

    Hi Experts, We have a severe performance problem with R/3 whenever BW jobs scheduled to bring the data from R/3. Can anyone through some ideas why this is happening? Thanks & Regards, VSN. Message was edited by:         vsn

  • 2 master pages with table data flow

    Hi,   My form got 2 master pages. Each master page will display atleast once in the output preview. First page displays table data which may or may not flow to the second page depending on the no.of records. But, the form will show both the master pa