SQL Statement Dump

hi
We are getting the following sql statement dump, and i am not able to understand what should be done here, would anyone please advise
Registered qb: SEL$1 0xc4c8a150 (PARSER)
QUERY BLOCK SIGNATURE
signature (): qb_name=SEL$1 nbfros=1 flg=0
fro(0): flg=4 objn=272221 hint_alias="BSAD"@"SEL$1"
SPM: statement not found in SMB
SPM: statement not a candidate for auto-capture
Automatic degree of parallelism (ADOP)
Automatic degree of parallelism is disabled: Parameter.
PM: Considering predicate move-around in query block SEL$1 (#0)
Predicate Move-Around (PM)
PM: PM bypassed: disabled due to star transformation.
OPTIMIZER INFORMATION
----- Current SQL Statement for this session (sql_id=82mdu08rbcnyy) -----
EXPLAIN PLAN SET STATEMENT_ID='SAP_STMT' FOR /*+ 142235 */ SELECT "MANDT" , "BUKRS" , "KUNNR" , "UMSKS" , "UMSKZ" , "AUGDT" , "AUGBL" , "ZUONR"
, "GJAHR" , "BELNR" , "BUZEI" , "BUDAT" , "BLDAT" , "CPUDT" , "WAERS" , "XBLNR" , "BLART" , "MONAT" , "BSCHL" , "ZUMSK" , "SHKZG" , "GSBER" ,
"MWSKZ" , "DMBTR" , "WRBTR" , "MWSTS" , "WMWST" , "BDIFF" , "BDIF2" , "SGTXT" , "PROJN" , "AUFNR" , "ANLN1" , "ANLN2" , "SAKNR" , "HKONT" , "FK
ONT" , "FILKD" , "ZFBDT" , "ZTERM" , "ZBD1T" , "ZBD2T" , "ZBD3T" , "ZBD1P" , "ZBD2P" , "SKFBT" , "SKNTO" , "WSKTO" , "ZLSCH" , "ZLSPR" , "ZBFIX
" , "HBKID" , "BVTYP" , "REBZG" , "REBZJ" , "REBZZ" , "SAMNR" , "ANFBN" , "ANFBJ" , "ANFBU" , "ANFAE" , "MANSP" , "MSCHL" , "MADAT" , "MANST" ,
"MABER" , "XNETB" , "XANET" , "XCPDD" , "XINVE" , "XZAHL" , "MWSK1" , "DMBT1" , "WRBT1" , "MWSK2" , "DMBT2" , "WRBT2" , "MWSK3" , "DMBT3" , "W
RBT3" , "BSTAT" , "VBUND" , "VBELN" , "REBZT" , "INFAE" , "STCEG" , "EGBLD" , "EGLLD" , "RSTGR" , "XNOZA" , "VERTT" , "VERTN" , "VBEWA" , "WVER
W" , "PROJK" , "FIPOS" , "NPLNR" , "AUFPL" , "APLZL" , "XEGDR" , "DMBE2" , "DMBE3" , "DMB21" , "DMB22" , "DMB23" , "DMB31" , "DMB32" , "DMB33"
, "BDIF3" , "XRAGL" , "UZAWE" , "XSTOV" , "MWST2" , "MWST3" , "SKNT2" , "SKNT3" , "XREF1" , "XREF2" , "XARCH" , "PSWSL" , "PSWBT" , "LZBKZ" , "
LANDL" , "IMKEY" , "VBEL2" , "VPOS2" , "POSN2" , "ETEN2" , "FISTL" , "GEBER" , "DABRZ" , "XNEGP" , "KOSTL" , "RFZEI" , "KKBER" , "EMPFB" , "PRC
TR" , "XREF3" , "QSSKZ" , "ZINKZ" , "DTWS1" , "DTWS2" , "DTWS3" , "DTWS4" , "XPYPR" , "KIDNO" , "ABSBT" , "CCBTC" , "PYCUR" , "PYAMT" , "BUPLA"
, "SECCO" , "CESSION_KZ" , "PPDIFF" , "PPDIF2" , "PPDIF3" , "KBLNR" , "KBLPOS" , "GRANT_NBR" , "GMVKZ" , "SRTYPE" , "LOTKZ" , "FKBER" , "INTRE
NO" , "PPRCT" , "BUZID" , "AUGGJ" , "HKTID" , "BUDGET_PD" , "KONTT" , "KONTL" , "UEBGDAT" , "VNAME" , "EGRUP" , "BTYPE" , "PROPMANO" , "YYSTORE
" , "YYDELGRP" , "YYBOLNR" FROM "BSAD" WHERE "MANDT" = :A0 AND "KUNNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 ) AND "BUKRS" = :A6 AND "AUGDT" = :A7
user_id=27 user_name=SAPSR3 module=RSXPLORA action=7093
sql_id=82mdu08rbcnyy plan_hash_value=1162638466 problem_type=3
----- Current SQL Statement for this session (sql_id=82mdu08rbcnyy) -----
EXPLAIN PLAN SET STATEMENT_ID='SAP_STMT' FOR /*+ 142235 */ SELECT "MANDT" , "BUKRS" , "KUNNR" , "UMSKS" , "UMSKZ" , "AUGDT" , "AUGBL" , "ZUONR"
, "GJAHR" , "BELNR" , "BUZEI" , "BUDAT" , "BLDAT" , "CPUDT" , "WAERS" , "XBLNR" , "BLART" , "MONAT" , "BSCHL" , "ZUMSK" , "SHKZG" , "GSBER" ,
"MWSKZ" , "DMBTR" , "WRBTR" , "MWSTS" , "WMWST" , "BDIFF" , "BDIF2" , "SGTXT" , "PROJN" , "AUFNR" , "ANLN1" , "ANLN2" , "SAKNR" , "HKONT" , "FK
ONT" , "FILKD" , "ZFBDT" , "ZTERM" , "ZBD1T" , "ZBD2T" , "ZBD3T" , "ZBD1P" , "ZBD2P" , "SKFBT" , "SKNTO" , "WSKTO" , "ZLSCH" , "ZLSPR" , "ZBFIX
" , "HBKID" , "BVTYP" , "REBZG" , "REBZJ" , "REBZZ" , "SAMNR" , "ANFBN" , "ANFBJ" , "ANFBU" , "ANFAE" , "MANSP" , "MSCHL" , "MADAT" , "MANST" ,
"MABER" , "XNETB" , "XANET" , "XCPDD" , "XINVE" , "XZAHL" , "MWSK1" , "DMBT1" , "WRBT1" , "MWSK2" , "DMBT2" , "WRBT2" , "MWSK3" , "DMBT3" , "W
RBT3" , "BSTAT" , "VBUND" , "VBELN" , "REBZT" , "INFAE" , "STCEG" , "EGBLD" , "EGLLD" , "RSTGR" , "XNOZA" , "VERTT" , "VERTN" , "VBEWA" , "WVER
W" , "PROJK" , "FIPOS" , "NPLNR" , "AUFPL" , "APLZL" , "XEGDR" , "DMBE2" , "DMBE3" , "DMB21" , "DMB22" , "DMB23" , "DMB31" , "DMB32" , "DMB33"
, "BDIF3" , "XRAGL" , "UZAWE" , "XSTOV" , "MWST2" , "MWST3" , "SKNT2" , "SKNT3" , "XREF1" , "XREF2" , "XARCH" , "PSWSL" , "PSWBT" , "LZBKZ" , "
LANDL" , "IMKEY" , "VBEL2" , "VPOS2" , "POSN2" , "ETEN2" , "FISTL" , "GEBER" , "DABRZ" , "XNEGP" , "KOSTL" , "RFZEI" , "KKBER" , "EMPFB" , "PRC
TR" , "XREF3" , "QSSKZ" , "ZINKZ" , "DTWS1" , "DTWS2" , "DTWS3" , "DTWS4" , "XPYPR" , "KIDNO" , "ABSBT" , "CCBTC" , "PYCUR" , "PYAMT" , "BUPLA"
, "SECCO" , "CESSION_KZ" , "PPDIFF" , "PPDIF2" , "PPDIF3" , "KBLNR" , "KBLPOS" , "GRANT_NBR" , "GMVKZ" , "SRTYPE" , "LOTKZ" , "FKBER" , "INTRE
NO" , "PPRCT" , "BUZID" , "AUGGJ" , "HKTID" , "BUDGET_PD" , "KONTT" , "KONTL" , "UEBGDAT" , "VNAME" , "EGRUP" , "BTYPE" , "PROPMANO" , "YYSTORE
" , "YYDELGRP" , "YYBOLNR" FROM "BSAD" WHERE "MANDT" = :A0 AND "KUNNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 ) AND "BUKRS" = :A6 AND "AUGDT" = :A7
sql_text_length=2001
----- Explain Plan Dump -----
----- Plan Table -----
============
Plan Table
============
| Id | Operation | Name | Rows | Bytes | Cost | Time |
| 0 | SELECT STATEMENT | | | | 2 | |
| 1 | INLIST ITERATOR | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID | BSAD | 1 | 601 | 2 | 00:00:01 |
| 3 | INDEX RANGE SCAN | BSAD~1 | 1 | | 1 | 00:00:01 |
Predicate Information:
3 - access("MANDT"=:A0 AND (("KUNNR"=:A1 OR "KUNNR"=:A2 OR "KUNNR"=:A3 OR "KUNNR"=:A4 OR "KUNNR"=:A5)) AND "BUKRS"=:A6 AND "AUGDT"=:A7)
Content of other_xml column
===========================
db_version : 11.2.0.1
parse_schema : SAPSR3
plan_hash : 1162638466
plan_hash_2 : 3684135643
Outline Data:
/*+
BEGIN_OUTLINE_DATA
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('11.2.0.1')
DB_VERSION('11.2.0.1')
OPT_PARAM('query_rewrite_enabled' 'false')
OPT_PARAM('_optim_peek_user_binds' 'false')
OPT_PARAM('_optimizer_extended_cursor_sharing_rel' 'none')
OPT_PARAM('_optimizer_adaptive_cursor_sharing' 'false')
OPT_PARAM('_optimizer_use_feedback' 'false')
OPT_PARAM('star_transformation_enabled' 'true')
OPT_PARAM('optimizer_index_cost_adj' 20)
OPT_PARAM('_fix_control' '4728348:0 5483301:0 5705630:1 6626018:1 6440977:1 6972291:1 6399597:1 6430500:1 5099019:1 9196440:1 9495669:1 8
937971:1')
ALL_ROWS
OUTLINE_LEAF(@"SEL$1")
INDEX_RS_ASC(@"SEL$1" "BSAD"@"SEL$1" ("BSAD"."MANDT" "BSAD"."KUNNR" "BSAD"."BUKRS" "BSAD"."AUGDT" "BSAD"."AUGBL" "BSAD"."GJAHR" "BSAD"."B
ELNR" "BSAD"."BUZEI" "BSAD"."BUDAT"))
END_OUTLINE_DATA
Query Block Registry:
SEL$1 0xc4c8a150 (PARSER) [FINAL]
call(in-use=194136, alloc=229336), compile(in-use=233336, alloc=338904), execution(in-use=540368, alloc=544176)
End of Optimizer State Dump
Dumping Hints
=============
====================== END SQL Statement Dump ======================
thx
Jonu Joy

would anyone please advise It looks OK to me.

Similar Messages

  • Short dump in SAP R/3: SQL statement buffer overflow?

    Hello,
    I hope someone can help us with the following problem:
    A short dump in SAP R/3 (DBIF_RSQL_INVALID_RSQL, CX_SY_OPEN_SQL_DB)
    occurred during a delta load, which worked fine for several month.
    The custom code crashes at a FETCH NEXT CURSOR statement.
    I assume, it might be a SQL statement buffer overflow in SAP R/3?
    The problem can be reproduced by RSA3, and is therefore not time-dependent.
    The problem did not occur before or on the quality assurance system.
    Cursor code:
          Read all entries since last transfer (delta mechanism)
            OPEN CURSOR WITH HOLD s_cursor FOR
              SELECT * FROM ekko
                WHERE ebeln IN t_selopt_ekko.
    t_selopt_ekko has up to 60.000 data sets, which worked fine in the past.
    It is very likely that the amount of data during the first crash did not exceed this.
    SQL-Trace of RSA3 call:
    It seems that 25150 data set can be processed via fetch before the short dump occurs
    After that object SNAP is written:
    "...DBIF_RSQL_INVALID_RSQL...dynpen00 + 0xab0 at dymain.c:1645 dw.sapP82_D82
    Thdyn...Report für den Extraktoraufruf...I_T_FIELDS...Table IT_43[16x60]TH058FUNCTION=
    RSA3_GET_DATA_SIMPLEDATA=S_S_IF_SIMPLE-T_FIELDSTH100...shmRefCount  = 1...
    ...> 1st level extension part <...isUsed       = 1...isCtfyAble   = 1...> Shareable Table Header Data
    <...tabi         = Not allo......S_CURSORL...SAPLRSA3...LRSA3U06...SAPLRSA3...
    During dump creation the following occurs:
    "...SAPLSPIAGENTCW...CX_DYNAMIC_CHECK=...CRSFH...BALMSGHNDL...
    DBIF_RSQL_INVALID_RSQL...DBIF_RSQL_INVALID_RSQL...DB_ERR_RSQL_00013...
    INCL_ABAP_ERROR...DBIF_INCL_INTERNAL_ERROR...INCL_INTERNAL_ERROR...
    GENERAL_EXC_WITHOUT_RAISING...INCL_SEND_TO_ABAP...INCL_SEARCH_HINTS...
    INCL_SEND_TO_SAP...GENERAL_EXC_WITHOUT_RAISING...GENERAL_ENVIRONMENT...
    GENERAL_TRANSACTION...GENERAL_INFO...GENERAL_INFO_INTERNAL...
    DBIF_INCL_INTERNAL_CALL_CODE..."
    Basis says, that the Oracle data base works fine. The problem seems to be a SAP R/3 buffer.
    Does anyone had a similar problem or knows where such a buffer might be or how it can be enlarged?
    Best regards
    Thomas
    P.S.
    Found a thread that contains part of the dump message "dynpen00 + 0xab0 at dymain.c:1645":
    Thread: dump giving by std prg contains -> seems not to be helpful
    Found a similar thread:
    Thread: Short dump in RSA3 --Z Data Source -> table space or somting else?
    Edited by: Thomas Köpp on Apr 1, 2009 11:39 AM

    Hi Thomas,
          Its due to different field length.
    Just check it out in code after FETCH NEXT CURSOR what internal table you have mention.
    that internal table shoul deffined by taking refrence of ekko, because your code is
    OPEN CURSOR WITH HOLD s_cursor FOR
    SELECT * FROM ekko
    WHERE ebeln IN t_selopt_ekko.
    hope you got solution.
    Regards,

  • Error in SQL Statement: SAPSQL_INVALID_TABLENAME

    Hello all,
    While displaying contents of infocube i am getting strange error ..
    Error in SQL Statement: SAPSQL_INVALID_TABLENAME ABC
    Message no. DBMAN256
    ( Table name length is 16 )
    I am able to see the contents of Fact table.
    Could not found any solution till now.. Any lights , views will be very much helpful.
    Regards
    Nimesh

    hi Nimesh,
    check oss note 835816
    Symptom
    When you execute a query, a data-mart, SEM, APO or similar access, an SQL error 4004 occurs "Unknown table name" Open SQL: Short dump with UNCAUGHT_EXCEPTION CX_RSR_X_MESSAGE in the ABAP Call Stack, you find the RSDRC_BASIC_DB_QUERY_DATA_GET function module.
    Prior to this, relatively large datasets (more than 10%) were deleted from the InfoCube.
    Other terms
    Business Information Warehouse, Factview, DBMAN256, DBMAN
    256, SAPLRSDRS, DELETE, DELETE_FACTS, RSDRD_DELETE_FACTS
    Reason and Prerequisites
    During the purge, the fact tables are rebuilt again as of a certain percentage, for performance reasons. The factview is then not created again.
    Solution
    Views that are already missing can be compiled again with the SAP_FACTVIEWS_RECREATE report.
    The correction prevents the problem reappearing.
    BW 3.0B
               Import Support Package 27 for 3.0B (BW3.0B Patch27 or SAPKW30B27) into your BW system. The Support Package is available whennote 0723258 with the short text "SAPBWNews BW3.0B Support Package 27", which describes this Support Package in more detail, is released for customers.
    BW 3.10 Content
               Import Support Package 21 for 3.10 (BW3.10 Patch21 or SAPKW31021) into your BW system. The Support Package is available whennote 0723263 with the short text "SAPBWNews BW3.1 Content Support Package 21", which describes this Support Package in more detail, is released for customers.
    BW 3.50
               Import Support Package 13 for 3.5 (BW3.50 Patch13 or SAPKW35013) into your BW system. The Support Package is available when note 0765114 with the short text "SAPBWNews BW Support Package 13 NetWeaver'04  Stack 13", which describes this Support Package in more detail, is released for customers.
    In urgent cases you can use the correction instructions.
    These notes may already be available before the Support Package is released, to make information available in advance. However, the short text then still contains the words "preliminary version".

  • Maximum size of an SQL statement

    Hello,
    we get a short dump with runtime error DBIF_RSQL_SQL_ERROR and exception CX_SY_OPEN_SQL_DB.
    The dump occurs at the following select statement:
            select * from /rtc/tm_inuse
              appending table gt_zrtc4inuse
              where obj_name in lv_sel_copy
                and trkorr ne p_trkorr.
    We think the problem is the number of entries in the range table lv_sel_copy so that the maximum size of the SQL statement is reached.
    But how likely is the maximum size ?
    Depends the size on the data base ? We are using MaxDB 7.6, MaxDB 7.7.
    How can we determine the maximum size so that we can calculate the nubmer of entries in the range tabel.
    Any other idea or solution ?
    Thanks
    Arnfried

    Hi,
    You are getting this dump because maybe your entries are huge and it might have exceeded the buffer space of the table. You have to ask your basis team to increase the size of the buffer space.
    or,
    You can segregate the range values into smaller ranges and fetch from the database accordingly..
    You can see the size of the table space in DB02.
    or please refer this thread:
    Need help regarding short dumps in BW
    Edited by: sneha singhania on Jun 12, 2009 4:01 PM

  • The maximum size of an SQL statement has been exceeded.

    In ST22, abap dump shows that one of the possible reason was "The maximum size of an SQL statement has been exceeded."
    How can I know what's the maximum size and how to compute that size had been reached?
    Is this shown anywhere in the log?

    1. decalre temp_key as a table.
    2. use this package size option ....this gets the data in bite-sized chunks
    SELECT MATKL MATNR MEINS
    INTO corresponding fields of table TEMP_KEY package size 1000
    FROM MARA
    WHERE MATNR IN SO_MATNR.
    loop at temp_key.
    MOVE-CORRESPONDING TEMP_KEY TO ITAB_KEY1.
    IF WS_PCHR SPACE.
    CLEAR ITAB_CHAR.
    CLEAR ITAB_KEY1-CHARACTER. REFRESH ITAB_KEY1-CHARACTER.
    PERFORM GET_CHAR TABLES ITAB_CHAR ITAB_KEY1-CHARACTER
    USING ITAB_KEY1-MATNR.
    ENDIF.
    APPEND ITAB_KEY1. CLEAR ITAB_KEY1.
    endloop.
    ENDSELECT.

  • DBIF_RSQL_INVALID_RSQL The maximum size of an SQL statement was exceeded

    Dear,
    I would appreciate a helping hand
    I have a problem with a dump I could not find any note that I can help solve the problem.
    A dump is appearing at various consultants which indicates the following.
    >>> SELECT * FROM KNA1                     "client specified
    559                  APPENDING TABLE IKNA1
    560                  UP TO RSEUMOD-TBMAXSEL ROWS BYPASSING BUFFER
    ST22
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "/1BCDWB/DBKNA1" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
         and
        therefore caused a runtime error.
        The reason for the exception is:
        The SQL statement generated from the SAP Open SQL statement violates a
        restriction imposed by the underlying database system of the ABAP
        system.
        Possible error causes:
         o The maximum size of an SQL statement was exceeded.
         o The statement contains too many input variables.
         o The input data requires more space than is available.
         o ...
        You can generally find details in the system log (SM21) and in the
        developer trace of the relevant work process (ST11).
        In the case of an error, current restrictions are frequently displayed
        in the developer trace.
    SQL sentence
    550     if not %_l_lines is initial.
    551       %_TAB2[] = %_tab2_field[].
    552     endif.
    553   endif.
    554 ENDIF.
    555 CASE ACTION.
    556   WHEN 'ANZE'.
    557 try.
    >>> SELECT * FROM KNA1                     "client specified
    559                  APPENDING TABLE IKNA1
    560                  UP TO RSEUMOD-TBMAXSEL ROWS BYPASSING BUFFER
    561    WHERE KUNNR IN I1
    562    AND   NAME1 IN I2
    563    AND   ANRED IN I3
    564    AND   ERDAT IN I4
    565    AND   ERNAM IN I5
    566    AND   KTOKD IN I6
    567    AND   STCD1 IN I7
    568    AND   VBUND IN I8
    569    AND   J_3GETYP IN I9
    570    AND   J_3GAGDUMI IN I10
    571    AND   KOKRS IN I11.
    572
    573   CATCH CX_SY_DYNAMIC_OSQL_SEMANTICS INTO xref.
    574     IF xref->kernel_errid = 'SAPSQL_ESCAPE_WITH_POOLTABLE'.
    575       message i412(mo).
    576       exit.
    577     ELSE.
    wp trace:
    D  *** ERROR => dySaveDataBindingValue: Abap-Field= >TEXT-SYS< not found [dypbdatab.c  510]
    D  *** ERROR => dySaveDataBindingEntry: dySaveDataBindingValue() Rc=-1 Reference= >TEXT-SYS< [dypbdatab.c  430]
    D  *** ERROR => dySaveDataBinding: dySaveDataBindingEntry() Rc= -1 Reference=>TEXT-SYS< [dypbdatab.c  137]
    Y  *** ERROR => dyPbSaveDataBindingForField: dySaveDataBinding() Rc= 1 [dypropbag.c  641]
    Y  *** ERROR => ... Dynpro-Field= >DISPLAY_SY_SUBRC_TEXT< [dypropbag.c  642]
    Y  *** ERROR => ... Dynpro= >SAPLSTPDA_CARRIER< >0700< [dypropbag.c  643]
    D  *** ERROR => dySaveDataBindingValue: Abap-Field= >TEXT-SYS< not found [dypbdatab.c  510]
    D  *** ERROR => dySaveDataBindingEntry: dySaveDataBindingValue() Rc=-1 Reference= >TEXT-SYS< [dypbdatab.c  430]
    D  *** ERROR => dySaveDataBinding: dySaveDataBindingEntry() Rc= -1 Reference=>TEXT-SYS< [dypbdatab.c  137]
    Y  *** ERROR => dyPbSaveDataBindingForField: dySaveDataBinding() Rc= 1 [dypropbag.c  641]
    Y  *** ERROR => ... Dynpro-Field= >DISPLAY_FREE_VAR_TEXT< [dypropbag.c  642]
    Y  *** ERROR => ... Dynpro= >SAPLSTPDA_CARRIER< >0700< [dypropbag.c  643]
    I thank you in advance
    If you require other information please request

    Hi,
    Under certain conditions, an Open SQL statement with range tables can be reformulated into a FOR ALL ENTRIES statement:
        DESCRIBE TABLE range_tab LINES lines.
        IF lines EQ 0.
          [SELECT for blank range_tab]
        ELSE.
          SELECT .. FOR ALL ENTRIES IN range_tab ..
          WHERE .. f EQ range_tab-LOW ...
          ENDSELECT.
        ENDF.
    Since FOR ALL ENTRIES statements are automatically converted in accordance with the database restrictions, this solution is always met by means of a choice if the following requirements are fulfilled:
    1. The statement operates on transparent tables, on database views or on a projection view on a transparent table.
    2. The requirement on the range table is not negated. Moreover, the range table only contains entries with range_tab-SIGN = 'I'
    and only one value ever occurs in the field range_tab OPTION.
    This value is then used as an operator with operand range_tab-LOW or range_tab-HIGH.In the above example, case 'EQ range_tab-LOW' was the typical case.
    3. Duplicates are removed from the result by FOR ALL ENTRIES.This must not falsify the desired result, that is, the previous Open SQL statement can be written as SELECT DISTINCT.
    For the reformulation, if the range table is empty it must be handled in a different way:with FOR ALL ENTRIES, all the records would be selected here while this applies for the original query only if the WHERE clause consisted of the 'f IN range_tab' condition.
    FOR ALL ENTRIES should also be used if the Open SQL statement contains several range tables.Then (probably) the most extensive of the range tables which fill the second condition is chosen as a FOR ALL ENTRIES table.
    OR
    What you could do in your code is,
    prior to querying;
    since your select options parameter is ultimately an internal range table,
    1. split the select-option values into a group of say 3000 based on your limit,
    2. run your query against each chunck of 3000 parameters,
    3. then put together the results of each chunk.
    For further reading, you might want to have a look at the Note# 13607 as the first suggestion is what I read from the note.

  • SQL statement in servlet giving error

    Please let me know if I need to post this on a different forum, but I thought it was applicable to here.
    First, let me preface this post by saying I've inserted hardcoded values at the DB (Oracle) level and it worked just fine, so most of the statement is sound. All the values inserted properly when testing it that way. Also, I've printed the SQL statement to the console and all looks ok there, too.
    Out of this, I'm getting an error citing the following:
    java.lang.ArrayIndexOutOfBoundsException
    also occasionally getting the following error:
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    In my servlet, I'm attempting the following:
    prior to the insert statement, I'm retrieving the last row number to start the increment from as in:
    Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rst = stmt.executeQuery("select CHANGE_CTRL_ID from CHANGE_CONTROL_USER order by CHANGE_CTRL_ID");
         rst.last();
         int lastRowNum = Integer.valueOf(rst.getString("CHANGE_CTRL_ID")).intValue();
         rst.close();
         stmt.close();
    ------------ then ------------------------------------------------
    String preparedQuery = "INSERT ALL " +
    "INTO CHANGE_CONTROL_USER " +
    "(CHANGE_CTRL_ID,REQUESTOR_NAME,REQUESTOR_EMAIL,BUS_CONTACT,DEPT,LOCATION,PHONE_NUM,DATE_REQ," +
    "BUSVP,VP_PHONE,VP_DATE,BRANCH,PRIORITY,OPS_MAN_CHG,OPS_MAN_PPCHAP,TRAIN_REQ," +
    "EXIST_SYS_FLD_CHG,BUS_RULES_CHG,NEW_CODING,NEW_BUS_RULE,NEW_SYS_FIELD,REQ_TYPE_OTHER,REQ_OTHER_SPECIFY,IMPACT_RE_COLL," +
    "IMPACT_DEF_LM,IMPACT_DEF_REC_NRE,IMPACT_AUDIT,IMPACT_PERS_COLL,IMPACT_DEF_FCL,IMPACT_BUS_TECH,IMPACT_LEGAL,IMPACT_PRIV_COLL," +
    "IMPACT_DEF_BKRUP_RE,IMPACT_DEC_SUPT,IMPACT_RISK_MGT,IMPACT_DEF_REO,IMPACT_DEF_BKRUP_NRE,IMPACT_QUALSVCS,IMPACT_INTERNAL_CTRL,IMPACT_DEF_WKFL," +
    "IMPACT_DEF_WKOUT,IMPACT_TRAIN_TPI,IMPACT_OTHER,IMPACT_DEF_MGT,IMPACT_DEF_TAX,IMPACT_VEND_MGT,IMPACT_DEF_CTRL,IMPACT_DEF_REC_RE," +
    "IMPACT_BUS_ADMIN,IMPACT_OTHER_SPECIFY,CHANGE_IN_KPMG,CHANGE_IN_OTS,CHANGE_IN_NFR,CHANGE_IN_ARR,CHANGE_IN_BRR, CHANGE_IN_PROC_IMP," +
    "CHANGE_IN_INT_CITI_POL,CHANGE_IN_OTHER,CHANGE_IN_OTHER_SPECIFY, CHANGE_INIT_DETAILS,REQ_INFO_DESCRIPT,REQ_INFO_EXPLAIN_CURRBUS,REQ_INFO_EXPLAIN_PROPOSED,REQ_BEN_PROP_BENEFIT,REQ_BEN_FIN_IMPLEMENT," +
    "REQ_BEN_OPS_IMPLEMENT,YES_FORM,VULN_ASSESS, CBA_CHG, RISK_ACCEPT,MARSITEM, GCCRFP, APP_COMPL_QUES,CAP_EXPEND)" +
    " VALUES (changecontrol_user_seq.nextval,?,?,?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?," + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
    + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
    + "INTO CHANGE_CONTROL_ADMIN "
    + "(AID,CHANGE_CTRL_ID,ADMNAME,CLOSEDATE,ACTIVE)"
    + "VALUES (changecontrol_admin_seq.nextval, changecontrol_user_seq.currval,NULL, NULL, -1)"
    + "SELECT object_name AS REQUESTOR_NAME FROM all_objects where rownum <= 1;";     
    also I've declared all the respective strings for the PreparedQuery statement.
    If you need to see those, here they are:
    PreparedStatement pstmt = connection.prepareStatement(preparedQuery);
                   // stmt = connection.stmt("INSERT INTO RMIS_USER VALUES (?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,?,?,to_date(?,'YYYY-MM-DD HH:MI:SS')");
              pstmt.setInt(1,++lastRowNum);
              pstmt.setString(2,reqName);
              pstmt.setString(3,reqemail);
              pstmt.setString(4,buscont);
              pstmt.setString(5,reqDept);
              pstmt.setString(6,reqLocale);
              pstmt.setString(7,phone_num);
              pstmt.setDate(8,dtreq);
              //pstmt.setCalendar(8,rtnow);
              pstmt.setString(9,busvp_email);
              pstmt.setString(10,vpphone);
              pstmt.setDate(11,dt);
              pstmt.setString(12,branch);
              pstmt.setString(13,priority);
              pstmt.setString(14,opsmanchg);
              pstmt.setString(15,opsmanppchap);
              pstmt.setString(16,train_req);
              pstmt.setString(17,reqexist_sys_fld_chg);
              pstmt.setString(18,reqbus_rules_chg);
              pstmt.setString(19,reqnew_coding);
              pstmt.setString(20,reqnewbus_rule );
              pstmt.setString(21,reqnew_sys_fld);
              pstmt.setString(22,reqother);
              pstmt.setString(23,req_other_specify);
              pstmt.setString(24,imp_recoll);
              pstmt.setString(25,imp_deflm);
              pstmt.setString(26,imp_defrecnre);
              pstmt.setString(27,imp_audit);
              pstmt.setString(28,imppers_coll);
              pstmt.setString(29,imp_deffcl);
              pstmt.setString(30,imp_bustech);
              pstmt.setString(31,imp_legal);
              pstmt.setString(32,imp_privcoll);
              pstmt.setString(33,imp_defbkre);
              pstmt.setString(34,imp_decsupt);
              pstmt.setString(35,imp_riskmgt);
              pstmt.setString(36,imp_defreo);
              pstmt.setString(37,imp_defbknre);
              pstmt.setString(38,imp_qualsvc);
              pstmt.setString(39,imp_intlctrl);
              pstmt.setString(40,imp_defwkfl);
              pstmt.setString(41,imp_defwkout);
              pstmt.setString(42,imp_trtpi);
              pstmt.setString(43,impact_other);
              pstmt.setString(44,imp_defmgt);
              pstmt.setString(45,imp_deftax);
              pstmt.setString(46,imp_vendmgt);
              pstmt.setString(47,imp_defctrl);
              pstmt.setString(48,imp_defrecre);
              pstmt.setString(49,imp_busadm);
              pstmt.setString(50,impact_other_specify);
              pstmt.setString(51,change_in_kpmg);
              pstmt.setString(52,change_in_ots);
              pstmt.setString(53,change_in_nfr);
              pstmt.setString(54,change_in_arr);
              pstmt.setString(55,change_in_brr);
              pstmt.setString(56,change_in_proc_imp);
              pstmt.setString(57,change_inter_citpol);
              pstmt.setString(58,change_in_other);
              pstmt.setString(59,change_in_other_specify);
              pstmt.setString(60,change_init_details);
              pstmt.setString(61,req_info_descript);
              pstmt.setString(62,req_info_explain_currbus);
              pstmt.setString63,req_info_explain_proposed);
              pstmt.setString(64,req_ben_prop_benefit);
              pstmt.setString(65,req_ben_fin_implement);
              pstmt.setString(66,req_ben_ops_implement);
              pstmt.setString(67,projyes);
              pstmt.setString(68,vulnass);
              pstmt.setString(69,cbachg);
              pstmt.setString(70,riskacc);
              pstmt.setString(71,marsitem);
              pstmt.setString(72,gccrfp);
              pstmt.setString(73,applcomp);
              pstmt.setString(74,capexpend);
              pstmt.executeUpdate();
    if anyone sees anything flawed here, please let me know!
    Thanks!
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20

    What a mess. First off, the line pstmt.setInt(1,++lastRowNum); just needs to go away. You're already using a sequence to set the value for the primary keys, you don't need to add a mistake like this.
    I then count 73 question marks (you can verify, I'm not counting again.) That would mean that your indices are off by one, and the ArrayIndexOutOfBounds is probably coming from pstmt.setString(74,capexpend); Dump the ++lastRowNum line, change all of your indices (after verifying the bind count!) and try it again.
    You can see an inherent weakness in the PreparedStatement clauses - one change means manually rewriting all of the indices. A solution is dumping all of your bind values into a List, then loop through the list to do your setXXX statements. If all binds are not of the same type, you can bind the values to some object that identifies type and use those objects in the list instead of the values. A little more complex, but easier to maintain in my opinion.

  • ABAP/4 Open SQL statement with WHERE ... LIKE and pattern too long

    Dear All,
    I am getting an error "ABAP/4 Open SQL statement with WHERE ... LIKE and pattern too long" while executing the following statement:
    CLEAR LS_RANGE.
    LS_RANGE-SIGN     = 'I'
    +LS_RANGE-OPTION     = 'CP'     +
    LS_RANGE-LOW     = 'S_ADMI_FCD'
    LS_RANGE-HIGH     = 'S_ADMI_FCD'
    COLLECT LS_RANGE INTO LT_RANGE.
    SELECT *
               FROM UST12
               INTO CORRESPONDING FIELDS OF TABLE LT_OBJECT_VALUES
               WHERE FIELD IN LT_RANGE
               AND AKTPS   = 'A'.
    For options like BT(Between), EQ(Equal) in range table, this above query is executing without dump. But for option CP, it simply dumps & in dump what i found is, it is concatenating the value in low & high.
    Does anyone have any idea regarding open sql using range tables.
    Thanks,
    Bhupinder

    Hi,
    I commented as follows:
    If  LS_RANGE-HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions. Yet operators CP and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields. If wildcards are entered on the selection screen, the system automatically uses the operator CP.
    If  LS_RANGE-HIGH  is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN and NOT BETWEEN that you use when you check if a field belongs to a range. You cannot use wildcard characters.
    You can try:
    CLEAR LS_RANGE.
    LS_RANGE-SIGN = 'I'.
    +LS_RANGE-OPTION = 'CP' +
    LS_RANGE-LOW = 'S_ADMI_FCD'.
    LS_RANGE-HIGH = 'S_ADMI_FCD'.
    FIND '*' IN LS_RANGE.
    IF sy-subrc = 0.
      LS_RANGE-OPTION = 'CP'.
    ELSE.
      LS_RANGE-OPTION = 'EQ'.
    ENDIF.
    COLLECT LS_RANGE INTO LT_RANGE.
    SELECT *
    FROM UST12
    INTO CORRESPONDING FIELDS OF TABLE LT_OBJECT_VALUES
    WHERE FIELD IN LT_RANGE
    AND AKTPS = 'A'.
    If you use wildcards the LS_RANGE  length should not exceed 10 characters.
    Hope this information is help to you.
    Regards,
    José

  • Excuting multiple sql statements

    Hi to everybody.
    I'm quite new to Oracle even if i have quite a big experience with MySQL and SQL commands. I'm facing a problem that I suppose it is a really basic one.
    I received a dump of an Oracle database in a .sql format. I mean that both the schema and the data are build through a large number of sql statements. In particular the schema is made through a lot of "create table ..." while the data are built through "insert into..". My need is to import these database in a fresh Oracle database Oracle 10 g XE.
    I've installed it on a Debian system and i can succesfully execute a single SQL command both through the web interface http://localhost:8080/apex and logging as oracle user through the sqlplus username/passwd command.
    My problem is that the data are split on about 12000 SQL "INSERT INTO.." so executing all of them one by one could be a little annoying :-)
    <u>So I'm asking if there is a way to instruct Oracle to execute multiple SQL statements reading it from a file (like MySQL does for example).</u>
    I' m considering to write a script to do it if there's no better way. I know that there're better way to dump databases in Oracle but I can change the .sql format since it is the only one that I got.

    in SQL*Plus you can execute a SQL file with the start command or it's shorthand version @:SQL> start filename.sql
    or
    SQL> @filename.sql

  • Trace all sql statements

    Hi,
    Is it possible to trace all the SQL's into one trace file or any other alternative to capture all the SQL statements.

    1. Export will take some time or a long time to run.
    You will have to either
    a. Use CONSISTENT=Y (and hope that you are able to get a consistent export)
    b. Stop Transactions for the duration.
    In option a. if you do allow transactions those transactions will appear neither in the Export NOR in the "trace file" that you will be generating later !! You WILL lose transactions.
    2. There's no way to get a "trace file" to capture all SQL statements and bind values across multiple database sessions such that they are properly synchronised in time.
    a. You can't get a trace file that you can simply run to reapply transactions.
    b. You can't sequence transactions from multiple sessions running concurrently.
    3. How fast do you REALLY think you will be able to apply that "trace file" (which, in any case, you CANNOT generate) ? It will take noticeable to considerable time.
    4. How do you propose to transfer the Export dump to the remote location ? When you have no network connectivity ? Via tapes, transfered by courier ? Then why can't you transfer a Database Hot Backup and ArchiveLogs via tapes, transferred by courier ?
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • MDM Database command execution error. A SQL statement failed to execute

    Hi,
    When we tried to execute an MDM Java query modify/create, we get the following dump.
    Is this anything to do with the parameters that we pass or is it something to do with the database ?
    We have checked the code and we do not find anything wrong with the code at all.
    We are using Java API 5.5.63.73 and calling MDM API's using WebDynpro for Java.
    I have noticed this issue has been raised here as well :
    Database command execution error. (While mounting a repository)
    com.sap.mdm.commands.CommandException:
    com.sap.mdm.internal.protocol.manual.ServerException: Database command execution error. A SQL
    statement failed to execute. The actual error may have been written to a log file. at
    com.sap.mdm.data.commands.ModifyRecordCommand.execute(ModifyRecordCommand.java:163) at
    Regards,
    Subramanian V.
    Edited by: Subramanian Venkateswaran on Dec 10, 2008 8:11 PM

    Hi Subramanian  ,
    The error looks more like a problem with the data base or MDM system rather than the java code.
    Which is the underlying database you are using with MDM? As some users have faced some difficulties when working with the DB2 Data base,If this is the data base you too are working upon then may be the issue could be similar,if possible try using the Oracle or SQL data base as these databse show more compatibility than a DB2 when working with MDM .
    Also check the MDM users autorization and authentication to modifyor create recordrs in MDM.try given the user the ADMIN rights,and tehn try and see if teh user is able to modify/Create the mdm records.
    Lastly you can check the database instance and listener configuration correctly.try restarting the Database service form the system if possible.
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • How do I use SQL statements to perform calculations with form fields????

    Please help!!! I don't know how to use a SQL statement within my APEX form......
    My form is below. The user will enter the values in the form. Click on Submit. Then we need to run a SQL select statement with those values.
    Our form looks like this:
    Start_Date ____________
    Per_Period ____________
    Period ____________
    [Submit Button]
    The user will enter these 3 values in the form.
    This is an example of an user providing the values:
    Start_Date 03/14/08_______
    Per_Period $200.00________
    Period 4____________
    [Submit Button]
    Then they will click the Submit Button.
    The SQL statement (BELOW) returns output based on the users selections:
    START_DATE PER_PERIOD PERIOD
    14-MAR-2008 00:00 200 Week 1 of 4
    21-MAR-2008 00:00 200 Week 2 of 4
    28-MAR-2008 00:00 200 Week 3 of 4
    04-APR-2008 00:00 200 Week 4 of 4
    Total 800
    This is the full text of the SQL that makes the output above:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr') as start_date,
    4 as periods,
    'Week' as period,
    200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
    union all select 'BiWeek', 14, 0 from dual
    union all select 'Month', 0, 1 from dual
    union all select 'ByMonth', 0, 2 from dual
    union all select 'Quarter', 0, 3 from dual
    union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
    per_period,
    c.period||' '||level||' of '||c.periods period
    from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
    when 1 then 'Total'
    else to_char(start_date)
    end start_date,
    sum(per_period) per_period,
    period
    from t1
    group by rollup ((start_date, period))
    THANKS VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You're just doing a parameterized report, where the input fields are your parameters.
    Check out the Advanced Tutorial titled Parameterized Report here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_query.htm#BGBEEBJA
    Good luck,
    Stew

  • HOW TO: Post a SQL statement tuning request - template posting

    This post is not a question, but similar to Rob van Wijk's "When your query takes too long ..." post should help to improve the quality of the requests for SQL statement tuning here on OTN.
    On the OTN forum very often tuning requests about single SQL statements are posted, but the information provided is rather limited, and therefore it's not that simple to provide a meaningful advice. Instead of writing the same requests for additional information over and over again I thought I put together a post that describes how a "useful" post for such a request should look like and what information it should cover.
    I've also prepared very detailed step-by-step instructions how to obtain that information on my blog, which can be used to easily gather the required information. It also covers again the details how to post the information properly here, in particular how to use the \ tag to preserve formatting and get a fixed font output:
    http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
    So again: This post here describes how a "useful" post should look like and what information it ideally covers. The blog post explains in detail how to obtain that information.
    In the future, rather than requesting the same additional information and explaining how to obtain it, I'll simply refer to this HOW TO post and the corresponding blog post which describes in detail how to get that information.
    *Very important:*
    Use the \ tag to enclose any output that should have its formatting preserved as shown below.
    So if you want to use fixed font formatting that preserves the spaces etc., do the following:
    \   This preserves formatting
    \And it will look like this:
       This preserves formatting
       . . .Your post should cover the following information:
    1. The SQL and a short description of its purpose
    2. The version of your database with 4-digits (e.g. 10.2.0.4)
    3. Optimizer related parameters
    4. The TIMING and AUTOTRACE output
    5. The EXPLAIN PLAN output
    6. The TKPROF output snippet that corresponds to your statement
    7. If you're on 10g or later, the DBMS_XPLAN.DISPLAY_CURSOR output
    The above mentioned blog post describes in detail how to obtain that information.
    Your post should have a meaningful subject, e.g. "SQL statement tuning request", and the message body should look similar to the following:
    *-- Start of template body --*
    The following SQL statement has been identified to perform poorly. It currently takes up to 10 seconds to execute, but it's supposed to take a second at most.
    This is the statement:
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id;It should return data from a table in a specific order.
    The version of the database is 11.1.0.7.
    These are the parameters relevant to the optimizer:
    SQL>
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_capture_sql_plan_baselines boolean     FALSE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      11.1.0.7
    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>
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     8
    SQL>
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL>
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>
    SQL> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL>
    SQL> select
      2             sname
      3           , pname
      4           , pval1
      5           , pval2
      6  from
      7           sys.aux_stats$;
    SNAME                PNAME                     PVAL1 PVAL2
    SYSSTATS_INFO        STATUS                          COMPLETED
    SYSSTATS_INFO        DSTART                          01-30-2009 16:25
    SYSSTATS_INFO        DSTOP                           01-30-2009 16:25
    SYSSTATS_INFO        FLAGS                         0
    SYSSTATS_MAIN        CPUSPEEDNW              494,397
    SYSSTATS_MAIN        IOSEEKTIM                    10
    SYSSTATS_MAIN        IOTFRSPEED                 4096
    SYSSTATS_MAIN        SREADTIM
    SYSSTATS_MAIN        MREADTIM
    SYSSTATS_MAIN        CPUSPEED
    SYSSTATS_MAIN        MBRC
    SYSSTATS_MAIN        MAXTHR
    SYSSTATS_MAIN        SLAVETHR
    13 rows selected.Here is the output of EXPLAIN PLAN:
    SQL> explain plan for
      2  -- put your statement here
      3  select
      4             *
      5  from
      6             t_demo
      7  where
      8             type = 'VIEW'
      9  order by
    10             id;
    Explained.
    Elapsed: 00:00:00.01
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    14 rows selected.Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> rem Set the ARRAYSIZE according to your application
    SQL> set autotrace traceonly arraysize 100
    SQL> select
      2             *
      3  from
      4             t_demo
      5  where
      6             type = 'VIEW'
      7  order by
      8             id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    Execution Plan
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    60 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |     1 |    60 |     0   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    Statistics
              0  recursive calls
              0  db block gets
         149101  consistent gets
            800  physical reads
            196  redo size
        1077830  bytes sent via SQL*Net to client
          16905  bytes received via SQL*Net from client
           1501  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         149938  rows processed
    SQL>
    SQL> disconnect
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsThe TKPROF output for this statement looks like the following:
    TKPROF: Release 11.1.0.7.0 - Production on Mo Feb 23 10:23:08 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: orcl11_ora_3376_mytrace1.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select
    from
             t_demo
    where
             type = 'VIEW'
    order by
             id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch     1501      0.53       1.36        800     149101          0      149938
    total     1503      0.53       1.36        800     149101          0      149938
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 88 
    Rows     Row Source Operation
    149938  TABLE ACCESS BY INDEX ROWID T_DEMO (cr=149101 pr=800 pw=0 time=60042 us cost=0 size=60 card=1)
    149938   INDEX RANGE SCAN IDX_DEMO (cr=1881 pr=1 pw=0 time=0 us cost=0 size=0 card=1)(object id 74895)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                    1501        0.00          0.00
      db file sequential read                       800        0.05          0.80
      SQL*Net message from client                  1501        0.00          0.69
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> -- put your statement here
    SQL> -- use the GATHER_PLAN_STATISTICS hint
    SQL> -- if you're not using STATISTICS_LEVEL = ALL
    SQL> select /*+ gather_plan_statistics */
      2  *
      3  from
      4  t_demo
      5  where
      6  type = 'VIEW'
      7  order by
      8  id;
    149938 rows selected.
    Elapsed: 00:00:02.21
    SQL>
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  d4k5acu783vu8, child number 0
    select   /*+ gather_plan_statistics */          * from          t_demo
    where          type = 'VIEW' order by          id
    Plan hash value: 1390505571
    | Id  | Operation                   | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT            |          |      1 |        |    149K|00:00:00.02 |     149K|   1183 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_DEMO   |      1 |      1 |    149K|00:00:00.02 |     149K|   1183 |
    |*  2 |   INDEX RANGE SCAN          | IDX_DEMO |      1 |      1 |    149K|00:00:00.02 |    1880 |    383 |
    Predicate Information (identified by operation id):
       2 - access("TYPE"='VIEW')
    20 rows selected.I'm looking forward for suggestions how to improve the performance of this statement.
    *-- End of template body --*
    I'm sure that if you follow these instructions and obtain the information described, post them using a proper formatting (don't forget about the \ tag) you'll receive meaningful advice very soon.
    So, just to make sure you didn't miss this point:Use proper formatting!
    If you think I missed something important in this sample post let me know so that I can improve it.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Alex Nuijten wrote:
    ...you missed the proper formatting of the Autotrace section ;-)Alex,
    can't reproduce, does it still look unformatted? Or are you simply kidding? :-)
    Randolf
    PS: Just noticed that it actually sometimes doesn't show the proper formatting although the code tags are there. Changing to the \ tag helped in this case, but it seems to be odd.
    Edited by: Randolf Geist on Feb 23, 2009 11:28 AM
    Odd behaviour of forum software                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • SQl statement cause extreme Portal log growth

    Our Portal server log file is growing very fast (30 - 50 Mb per minute). When examining the log file we see that the log file does contain only the error messages:
    #1.5#00096BF521750058005A9CA900001E480003E80BD8A2C263#1099562506968#/System/Database/sql/jdbc/common#sap.com/irj#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Guest#18####655e44612e4811d9b41300096bf52175#Thread[ThreadPool-Dispatcher,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error#1#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Java#com.sap.sql.jdbc.common_1123#com.sap.sql.log.OpenSQLResourceBundle#The SQL statement "" contains the semantics error[s]: #2#SELECT MIN("ID"),"PRIORITY" FROM "KMC_TQ_QUEUE" WHERE "NAMESPACE_HASH" = ? AND "NAMESPACE" = ? AND "TASK_STATE" = 1 GROUP BY "PRIORITY" ORDER BY 2 DESC#type check error: the expression >>"NAMESPACE"<< (LONGVARCHAR) is not comparable and must not be used with "="
    This message occurs more than 500 times per log file. It has something to do with Knowledge management, but we cannot find anything that triggers this sql statement.
    Any ideas?
    Noel Hendrikx & Pascal Rijnart

    SAP tells us in reaction to our customer message:
    "The table's definition is correct. What has to be changed is the
    computed type for field NAMESPACE and the generated file for the table.
    As I wrote before, if you make any change in the field NAMESPACE the
    new computation is started (so change the description which has no
    effect on the table's version on the database). Make the change and
    save the table in the SapNetWeaver Developer Studio. You will then
    see that the field's JDBC-type changes to VARCHAR.
    Choose 'Create archive' for Dictionary Project the table belongs to
    and deploy the sda on the database. Both can be done in the studio."
    Can anyone tell us what to do now?
    Noel Hendrikx

Maybe you are looking for

  • What is the path or TC for changing control of recon account in vendor

    Hi Gurus, Pl tell the TC or Path for changing the reconciliation account control for vendor as like in asset recon account. Pl itsUrgens Thanks in advance

  • How to update agent list after triggering workflow?

    Hi Guys,            Is there any function module to update the agent list after triggering the workflow? i mean after triggering workflow, the user is maintaining some approving officers in their table and they are expecting the workflow should route

  • Sync Problems with ES1

    Hi, I've been having a lot of hassle with syncing the ES1's LFO to the internal sync. The LFO seems to drift out of sync in relation to note-based events. It also seems to vary in its start-cycle depending on where in the timeline you start play (i.e

  • How do I get a .PNg file working as a lower third?

    I am doing news video for a site and they sent me their lower third graphic with their logo and it is in .PNG format.  I imported it but when I put it in video 2 layer above the video I want on top of it nothing shows up!  How do I fix this? 

  • HT1443 pay for the 10.6 or how high can i go in an upgraded version?

    My MacBook is about 4 years old now- Mac OS X 10.5.8. I want to install Google Drive but it requires Mac OS X 10.6 or higher. Do i pay for a 10.6 version or do i buy a higher version and how high can i go?