Performance problem(ANEA/ANEP table) in Select statement

Hi
I am using below select statement to fetch data.
Does the below where statement have performance issue?
can you Pls suggest.
1)In select of ANEP table, i am not using all the Key field in where condition. will it have performance problem?
2)does the order of where condition should be same as in table, if any one field order change also will have effect performance
SELECT bukrs                           
         anln1                          
         anln2                          
         afabe                          
         gjahr                        
         peraf                         
         lnran                         
         bzdat                          
         bwasl                        
         belnr                         
         buzei                         
         anbtr                       
         lnsan                         
    FROM anep
    INTO TABLE o_anep
    FOR ALL ENTRIES IN i_anla
   WHERE bukrs = i_anla-bukrs          
     AND anln1 = i_anla-anln1          
     AND anln2 = i_anla-anln2          
     AND afabe IN s_afabe              
     AND bzdat =< p_date                
     AND bwasl IN s_bwasl.              
  SELECT bukrs      
         anln1      
         anln2      
         gjahr      
         lnran       
         afabe      
         aufwv       
         nafal   
         safal       
         aafal      
         erlbt    
         aufwl      
         nafav    
         aafav     
         invzv   
         invzl      
    FROM anea
    INTO TABLE o_anea
    FOR ALL ENTRIES IN o_anep
   WHERE bukrs = o_anep-bukrs    
     AND anln1 = o_anep-anln1    
     AND anln2 = o_anep-anln2    
     AND gjahr = o_anep-gjahr    
     AND lnran = o_anep-lnran   
     AND afabe = o_anep-afabe.
Moderator message: Please Read before Posting in the Performance and Tuning Forum
Edited by: Thomas Zloch on Aug 9, 2011 9:37 AM

1. Yes. If you have only a few primary keys in youe WHERE condition that does affect the performance. But some times requirement itself may be in that way. We may not be knowing all the primary keys to given them in WHER conditon. If you know the values, then provide them without fail.
2. Yes. It's better to always follow the sequence in WHERE condition and even in the fields being fetched.
One important point is, whenever you use FOR ALL ENTRIES IN, please make sure that the itab IS NOT INITIAL i.e. the itab must have been filled in. So, place the same conditin before both the SELECT queries like:
IF i_anla[] IS NOT INITIAL.
SELECT bukrs                           
         anln1                          
         anln2                          
         afabe                          
         gjahr                        
         peraf                         
         lnran                         
         bzdat                          
         bwasl                        
         belnr                         
         buzei                         
         anbtr                       
         lnsan                         
    FROM anep
    INTO TABLE o_anep
    FOR ALL ENTRIES IN i_anla
   WHERE bukrs = i_anla-bukrs          
     AND anln1 = i_anla-anln1          
     AND anln2 = i_anla-anln2          
     AND afabe IN s_afabe              
     AND bzdat =< p_date                
     AND bwasl IN s_bwasl.              
ENDIF.
IF o_anep[] IS NOT INITIAL.
  SELECT bukrs      
         anln1      
         anln2      
         gjahr      
         lnran       
         afabe      
         aufwv       
         nafal   
         safal       
         aafal      
         erlbt    
         aufwl      
         nafav    
         aafav     
         invzv   
         invzl      
    FROM anea
    INTO TABLE o_anea
    FOR ALL ENTRIES IN o_anep
   WHERE bukrs = o_anep-bukrs    
     AND anln1 = o_anep-anln1    
     AND anln2 = o_anep-anln2    
     AND gjahr = o_anep-gjahr    
     AND lnran = o_anep-lnran   
     AND afabe = o_anep-afabe.
ENDIF.

Similar Messages

  • How imrove the peformance of VBFA table in select statements.

    Hi,
    whenever execute program in production, program execution will taking long time due to below select statement.
    Please help me how we imrove performance?
    SELECT vbelv vbeln posnn vbtyp_v
    FROM vbfa
    INTO TABLE l_i_vbfa
    FOR ALL ENTRIES IN l_i_bill_cs
    WHERE vbeln EQ l_i_bill_cs-vbeln
    AND posnn EQ '000010'
    AND vbtyp_n IN ('K', 'H'). "MOD-024--
    AND vbtyp_v IN ('K', 'H'). "MOD-024++
    SORT l_i_vbfa BY vbeln vbtyp_n.
    Regards,
    Naidu
    Moderator message: third time I have to remind you: for performance problems with VBFA table please search for previous discussions of the same topic
    Edited by: Thomas Zloch on Nov 9, 2010 12:41 PM

    Hi Naidu,
    ranges: r_vbtypv type vbfa-r_vbtyp_v.
      CLEAR r_vbtypv.
      r_vbtypv-option = 'EQ'.
      r_vbtypv-sign   = 'I'.
      r_vbtypv-low    = 'K'.
      APPEND r_vbtypv.
      CLEAR r_vbtypv.
      r_vbtypvl-option = 'EQ'.
      r_vbtypv-sign   = 'I'.
      r_vbtypv-low    = 'H'.
      APPEND r_vbtypv.
    sort l_i_bill_cs by vbenl.
    if not l_i_bill_cs[] is initial.
    SELECT vbelv vbeln posnn vbtyp_v
    FROM vbfa
    INTO TABLE l_i_vbfa
    FOR ALL ENTRIES IN l_i_bill_cs
    WHERE vbeln EQ l_i_bill_cs-vbeln
    AND posnn EQ '000010'
    AND vbtyp_v IN r_anlkl.
    endif.
    SORT l_i_vbfa BY vbeln vbtyp_n.
    Thanks,
    Nelson

  • Using plsql tables in select statement of report query

    Hi
    Anyone have experience to use plsql table to select statement to create a report. In otherwords, How to run report using flat file (xx.txt) information like 10 records in flat files and use this 10 records to the report and run pdf files.
    thanks in advance
    suresh

    hi,
    u can use the utl_file package to do that using a ref cursor query in the data model and u can have this code to read data from a flat file
    declare
    ur_file utl_file.file_type;
    my_result varchar2(250);
    begin
    ur_file := UTL_FILE.FOPEN ('&directory', '&filename', 'r') ;
    utl_file.get_line(ur_file, my_result);
    dbms_output.put_line(my_result);
    utl_file.fclose(ur_file);
    end;
    make sure u have an entry in ur init.ora saying that your
    utl_file_dir = '\your directory where ur files reside'
    cheers!
    [email protected]

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • Problem in creaing the logical tables by SELECT statement

    Hi,
    I have created logical tables in the physical layer of the OBIEE tool by "select statement". Connection Pool is set up properly for the repository. Rows of the tables are updating properly by clicking to the "Update Row Count" but when I am clicking to the "View Data" it shows the following error
    [nQSError:17001] Oracle Error code:936, message: ORA-00936:missing expression at OCI call OCIStmtExecute.
    [nQSError:17010]SQL statement preparation failed.
    Also for some tables data is coming properly by clicking to the "View Data" .
    I'm stack in this point and cannot move forward. Please, help me guys.
    Thanks
    Sandeep

    Hi
    I also face same type of error. Just do one thing Change the call interface OCI 10g to ODBC 3.5 and on Feature tab click revert to default.
    I think that will work properly.
    Best of Luck
    Thanks
    SIddhartha P

  • "Check Statistics" in the Performance tab. How to see SELECT statement?

    Hi,
    In a previous mail on SDN, it was explained (see below) that the "Check Statistics" in the Performance tab, under Manage in the context of a cube, executes the SELECT stament below.
    Would you happen to know how to see the SELECT statements that the "Check Statistics" command executes as mentioned in the posting below?
    Thanks
    ====================================
    When you hit the Check Statistics tab, it isn't just the fact tables that are checked, but also all master data tables for all the InfoObjects (characteristics) that are in the cubes dimensions.
    Checking nbr of rows inserted, last analyzed dates, etc.
    SELECT
    T.TABLE_NAME, M.PARTITION_NAME, TO_CHAR (T.LAST_ANALYZED, 'YYYYMMDDHH24MISS'), T.NUM_ROWS,
    M.INSERTS, M.UPDATES, M.DELETES, M.TRUNCATED
    FROM
    USER_TABLES T LEFT OUTER JOIN USER_TAB_MODIFICATIONS M ON T.TABLE_NAME = M.TABLE_NAME
    WHERE
    T.TABLE_NAME = '/BI0/PWBS_ELEMT' AND M.PARTITION_NAME IS NULL
    When you Refresh the stats, all the tables that need stats refreshed, are refreshed again. SInce InfoCube queries access the various master data tables in quereis, it makes sense that SAP would check their status.
    In looking at some of the results in 7.0, I'm not sure that the 30 day check is being doen as it was in 3.5. This is one area SAP retooled quite a bit.
    Yellow only indicates that there could be a problem. You could have stale DB stats on a table, but if they don't cause the DB optimizer to choose a poor execution plan, then it has no impact.
    Good DB stats are vital to query performance and old stats could be responsible for poor performance. I'm just syaing that the Statistics check yellow light status is not a definitive indicator.
    If your DBA has BRCONNECT running daily, you really should not have to worry about stats collection on the BW side except in cases immediately after large loads /deletes, and the nightly BRCONNECT hasn't run.
    BRCONNECT should produce a lof every time it runs showing you all the tables that it determeined should have stats refreshed. That might be worth a review. It should be running daily. If it is not being run, then you need to look at running stats collection from the BW side, either in Process Chains or via InfoCube automatisms.
    Best bet is to use ST04 to get Explain Plans of a poor running InfoCube query and then it can be reviewed to see where the time is being spent and whether stats ate a culprit.

    Hi,
    Thanks, this is what I came up with:
    st05,
    check SQL Trace, Activate Trace
    Now, in Rsa1
    on Cube, Cube1,
    Manage, Performance tab, Check Statistics
    Again, back to st05
    Deactivate Trace
    then click on Displace Trace
    Now, in the trace display, after scanning through  the output,
    “ … how do I see the SELECT statements that the "Check Statistics" command executes …”
    I will appreciate your help.

  • Create table as select statement.

    Hello Oracle Gurus,
    I am trying to create a table using select * from other table.
    The procedure that I am following is this:-
    I have a temp table whose signature is on commit delete rows.
    I insert records in this table.
    when I do select * from temp_table,perm_table I get some rows.
    then I try to create a result_table using this
    CREATE TABLE result_table
    AS SELECT * FROM temp_table,perm_table;
    I see the table in created but number of records in 0. Can anyone please explain where commit takes place while sequence in this query occurs.
    Thanks
    Edited by: user10696492 on Nov 10, 2009 8:47 AM

    Create table statement is a ddl - so an implicit commit is performed before the create statement begins. The implicit commit will delete all the rows from the temp table. If it is feasible change the definition of the temp table to on commit preserve rows.

  • Picking the right values from tables - SQL (select statement)

    Hi everyone,
    I'm facing the litlle(?) problem in Oracle environment.
    Let me explain:
    I have two tables.
    TABLE 1
    Id1 | Val1 | Id2 | Val2
    A | 44 | B | 36
    B | 36 | A | 44
    TABLE 2
    Id | Name
    A | New York
    B | Seattle
    I need to get from those tables, using SQL statement, result like this:
    Id1 | Val1 | Name1 | Id2 | Val2 | Name2
    A | 44 | New York | B | 36 | Seattle
    NOTE !! Very important!! If in table 1 we have crossed the same values in fields IdX and ValX in two rows (like in example)- just one of them should be presented as a result.
    I'm afraid it's a bit too complex. You, guys are my last hope.
    Looking forward for any solutions.
    Thanks in advance!

    jeneesh wrote:
    This can give you a startJaneesh, the OP specified that the duplication was across the ID and the VAL columns, but your solution only checks the ID's..
    SQL> ed
    Wrote file afiedt.buf
      1  with t1 as (select 'A' as id1, 44 as val1, 'A' as id2, 36 as val2 from dual union all
      2              select 'A', 36, 'A', 36 from dual)
      3      ,t2 as (select 'A' as id, 'New York' as name from dual union all
      4              select 'B', 'Seattle' from dual)
      5  -- END OF TEST DATA
      6  select distinct greatest(id1,id2) id1,
      7         case when id1 > id2 then val1 else val2 end val1,a.name name1,
      8         least(id1,id2) id2,
      9         case when id1 < id2 then val1 else val2 end val2,b.name name2
    10  from t1 t,t2 a,t2 b
    11  where greatest(id1,id2) = a.id
    12* and least(id1,id2) = b.id
    SQL> /
    I       VAL1 NAME1    I       VAL2 NAME2
    A         36 New York A         36 New York
    SQL>With this data I would have expected both rows to be returned as there is a difference in the val columns..
    SQL> ed
    Wrote file afiedt.buf
      1  with t1 as (select 'A' as id1, 44 as val1, 'A' as id2, 36 as val2 from dual union all
      2              select 'A', 36, 'A', 36 from dual)
      3      ,t2 as (select 'A' as id, 'New York' as name from dual union all
      4              select 'B', 'Seattle' from dual)
      5  -- END OF TEST DATA
      6      ,t3 as (select distinct id1, val1, id2, val2
      7              from
      8                (
      9                 select decode(switch,1,id2,id1) as id1
    10                       ,decode(switch,1,val2,val1) as val1
    11                       ,decode(switch,1,id1,id2) as id2
    12                       ,decode(switch,1,val1,val2) as val2
    13                 from (select id1, val1, id2, val2
    14                             ,case when id1||val1 > id2||val2 then 1 else 0 end as switch
    15                       from t1)
    16                )
    17             )
    18  --
    19  select t3.id1, t3.val1, t2_1.name
    20        ,t3.id2, t3.val2, t2_2.name
    21  from   t3 join t2 t2_1 on (t2_1.id = t3.id1)
    22*           join t2 t2_2 on (t2_2.id = t3.id2)
    SQL> /
    I       VAL1 NAME     I       VAL2 NAME
    A         36 New York A         36 New York
    A         36 New York A         44 New York

  • Create object type from multiple tables for select statement

    Hi there,
    I have 3 tables as given below and I wish to create an object type to group selected columns as 'attribute' from multiple tables. 
    I need to create 2 input parameters to pass in - 'attribute' and 'attribute value'  in PL/SQL and these 2 parameters will be
    passing in with 'column name' and 'column value'.  e.g. 'configuration' - the column name, 'eval' - the column value.
    Then, the PL/SQL will execute the select statement with the column and column value provided to output the record. 
    Pls advise and thank you.
    table ccitemnumber
    name                           null     type                                                                                                   
    ccitemnumber                   not null varchar2(20)                                                                                                                                                                                    
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    table productmodel
    productmodelnumber             not null varchar2(6)                                                                                            
    description                             varchar2(60)  
    accesstimems                            number                                                                                                 
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    table topmodel
    stmodelnumber                  not null varchar2(30)                                                                                           
    productfamily                           varchar2(60
    formfactor                              varchar2(10)                                                                                           
    modelheight                             varchar2(10)                                                                                           
    formattedcapacity                       number                                                                                                 
    formattedcapacity_uom                   varchar2(20)
    object type in database
    configuration                           varchar2(20)
    item_type                               varchar2(30)
    numberofheads                           varchar2(2)
    generation                              varchar2(10)
    numberofdiscs                           varchar2(2)
    factoryapplication                      varchar2(150)
    modelheight                             varchar2(10)
    formattedcapacity                       number                                                                                                 
    formattedcapac

    user12043838 wrote:
    Reason to do this as these fields are required to be grouped together as they are created in different tables. They are treated as 'attribute' (consists of many columns) of the part number. So, the PL/SQL is requested to design in a way able for user to pass in the column name and column value or part number, then the select statement should be able to query for the records. Another reason is a new column can be added easily without keep modifying those effected programs. Reuseable too.This basically equates to ... hard to code, hard to maintain, and poor performance.
    Are you really sure you want to do this? This isn't going to be easy-street as you seem to think it is, but it's a one way street to a poorly performing system with security vulnerabilities (google SQL Injection).
    I would highly recommend you reconsider your design decision here.

  • Performance problem while creating table at runtim

    I have pl/sql block like
    Begin
    Exceute immediate 'drop table x '
    Execute immediate 'create table x as select .... stament (complex select by joining 7-8 tables);
    Execute immediate ('create index ind1 on table x'); -- i am not writing the full syntax
    End;
    The select statement used in create table is fetching 10 millions of rows (approx).
    The above pl/sql block is taking 30-45 minutes.
    Without going in depth of query used in select (as i have to explain the functionality otherwise),
    Could any one please suggest to create a table in fatset way like nolooging or seperate tablespace with bigger block size or any change in any DB parameter etc.
    The db server is having excelent hardware configuration 32GB ram , multi CPU (16 CPUs) , Huge hardisk.
    Thanks

    CREATE OR REPLACE VIEW VW_CUST_ACCT_BUS_REQ AS
    SELECT FC.V_CUST_NUMBER,
    FC.V_ACCT_NUMBER,
    FC.V_ACCT_CUST_ROLE_CODE
    from Fct_Acct_Cust_Roles FC --current schema table
    join dim_jurisdiction DC on DC.V_JURISDICTION_CODE = FC.V_SRC_CNTRY_CODE
    JOIN VW_APPLN_PARAMS APP ON APP.V_PARAM_CATEGORY = 'KYC'
    AND APP.V_PARAM_IDENTIFIER =
    'KYC_PROCESSING_DATE'
    AND APP.N_CNTRY_KEY = DC.N_JURISDICTION_KEY
    AND FC.FIC_MIS_DATE = APP.d_Param_Date
    UNION
    SELECT BUS_CUST_ACCT.CUST_INTRL_ID,
    BUS_CUST_ACCT.ACCT_INTRL_ID,
    BUS_CUST_ACCT.CUST_ACCT_ROLE_CD
    FROM BUS_CUST_ACCT --another schema's table containing rows in millions.
    --Can you tell me any other method to acheive the above select
    CREATE TABLE vw_kyc_dr_ip as
    SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
    FCU.V_CUST_NUMBER v_cust_id,
    FACRS.V_CUST_NUMBER v_ip_cust_id,
    ROLS.F_CONTROLLING_ROLE f_cntrl_role
    FROM VW_CUST_BUS_REQ FCU -- This is another Mview it contains data approx 50,000
    JOIN VW_CUST_ACCT_BUS_REQ FACR/* see above view definition, contains rows in millions */ ON FCU.V_CUST_NUMBER = FACR.V_CUST_NUMBER
    JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER = FACRS.V_ACCT_NUMBER
    JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =FACRS.V_ACCT_CUST_ROLE_CODE
    UNION
    (SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
    FCU.V_CUST_NUMBER v_cust_id,
    FCR.V_RELATED_CUST_NUMBER v_ip_cust_id,
    'N' f_cntrl_role
    FROM VW_CUST_BUS_REQ FCU
    JOIN VW_CUST_CUST_BUS_REQ FCR ON FCU.V_CUST_NUMBER =
    FCR.V_CUST_NUMBER
    JOIN VW_APPLN_PARAMS P ON P.V_PARAM_IDENTIFIER = 'KYC_PROCESSING_DATE'
    AND P.V_PARAM_CATEGORY = 'KYC'
    AND FCR.D_RELATIONSHIP_EXPIRY_DATE >=
    P.D_PARAM_DATE
    JOIN DIM_JURISDICTION ON DIM_JURISDICTION.N_JURISDICTION_KEY =
    P.N_CNTRY_KEY
    AND DIM_JURISDICTION.V_JURISDICTION_CODE =
    FCU.V_SRC_CNTRY_CODE
    MINUS
    SELECT DISTINCT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
    FCU.V_CUST_NUMBER v_cust_id,
    FACRS.V_CUST_NUMBER v_ip_cust_id,
    'N'
    FROM VW_CUST_BUS_REQ FCU
    JOIN VW_CUST_ACCT_BUS_REQ FACR ON FCU.V_CUST_NUMBER =
    FACR.V_CUST_NUMBER
    JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER =
    FACRS.V_ACCT_NUMBER
    JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =
    FACRS.V_ACCT_CUST_ROLE_CODE
    AND ROLS.F_CONTROLLING_ROLE = 'Y'
    UNION
    (SELECT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
    FCU.V_CUST_NUMBER v_cust_id,
    FCR.V_CUST_NUMBER v_ip_cust_id,
    'N' f_cntrl_role
    FROM VW_CUST_BUS_REQ FCU
    JOIN VW_CUST_CUST_BUS_REQ FCR ON FCU.V_CUST_NUMBER =
    FCR.V_RELATED_CUST_NUMBER
    JOIN VW_APPLN_PARAMS P ON P.V_PARAM_IDENTIFIER = 'KYC_PROCESSING_DATE'
    AND P.V_PARAM_CATEGORY = 'KYC'
    AND FCR.D_RELATIONSHIP_EXPIRY_DATE >=
    P.D_PARAM_DATE
    JOIN DIM_JURISDICTION ON DIM_JURISDICTION.V_JURISDICTION_CODE =
    FCU.V_SRC_CNTRY_CODE
    AND DIM_JURISDICTION.N_JURISDICTION_KEY =
    P.N_CNTRY_KEY
    MINUS
    SELECT DISTINCT FCU.V_SRC_CNTRY_CODE JRSDCN_CD,
    FCU.V_CUST_NUMBER v_cust_id,
    FACRS.V_CUST_NUMBER v_ip_cust_id,
    'N'
    FROM VW_CUST_BUS_REQ FCU
    JOIN VW_CUST_ACCT_BUS_REQ FACR ON FCU.V_CUST_NUMBER =
    FACR.V_CUST_NUMBER
    JOIN VW_CUST_ACCT_BUS_REQ FACRS ON FACR.V_ACCT_NUMBER =
    FACRS.V_ACCT_NUMBER
    JOIN DIM_ACCT_CUST_ROLE_TYPE ROLS ON ROLS.V_ACCT_CUST_ROLE_CODE =
    FACRS.V_ACCT_CUST_ROLE_CODE
    AND ROLS.F_CONTROLLING_ROLE = 'Y'
    Kindlt advice me on technical side , i think it is difficult to make you understand functionality.

  • Performance problem when printing - table TSPEVJOB big size

    Hi,
    in a SAP ERP system there is performance problem when printing because table TSPEVJOB has many millions of entries.
    This table has reached a considerable size (about 90 Gb); db size is 200 Gb.
    Standard reports have been scheduled correctly and kernel of SAP ERP system is updated.
    I've tried to scheduled report RSPO1041 (instead of RSPO0041) to reduce entries but it is not possible run it during normal operations because it locks the printing system.
    Do you know why this table has increased ?
    Are there any reports to clean this table or other methods ?
    Thanks.
    Maurizio Manera

    Dear,
    Please see the Note 706478 - Preventing Basis tables from increasing considerably and
    Note 195157 - Application log: Deletion of logs.
    Note 1566659 - Table TSPEVJOB is filled excessively
    Note 1293472 - Spool work process hangs on semaphore 43
    Note 1362343 - Deadlocks in table TSP02 and TSPEVJOB
    Note 996455 - Deadlocks on TSP02 or TSPEVJOB when you delete
    For more information see the below link as,
    http://www.sqlservercurry.com/2008/04/how-to-delete-records-from-large-table.html
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=91179
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83525
    If any doubts Let me know.
    Thomas
    Edited by: thomas_raja on Aug 7, 2011 12:29 PM

  • Using Nested Table in Select Statement

    Hi all ,
    Can i use the PL/SQL nested table or Varray
    in the select statement as a normal table joined with other database tables.
    i.e.
    I have a nested table NT_1 in PL/SQL proc
    i have to use this NT_1 in the select statement as
    select xxx from
    tab_1,
    tab_2,
    NT_1
    where
    < some conditional joins >.
    Please help me in this regard.
    regds
    Dhananjaya.H

    you can not use a varray as part of a SQL Statement in order to build joins.
    Can you explain better what do you want to do ?
    Joel P�rez

  • Dynamic internal table from SELECT - statement ?

    Hi, is it possible to define an internal table just after a select statement is executed so that this internal table holds all the data that come back from the statement ?
    thanks in advance,

    Check the link -
    Re: Create Dynamic internal table
    Regards,
    Amit

  • USING INDEXES DEFINED ON TABLES IN SELECT STATEMENTS

    Hi there,
    I would like to ask a simple question, how i can use indexes defined on certain columns on one of my database tables in a select clause:
    table name: B2TECDOC
    schema name: AWDBT1M4
    indexes defined: AWDBT1M4.B2TECDOC_B2TECDOCKEY
    index AWDBT1M4.B2TECDOC_B2TECDOCKEY is defined on columns:
    documentname
    documenttype
    organizationid
    organizationtype
    revision
    sequence
    versionnumbercould you help me construct a select sql using this index?
    another question is will using this index in my select clause increase the overall query performance?
    thanks
    rohan

    A query like
    SELECT *
      FROM AWDBT1M4.B2TECDOC
    WHERE documentname = <<some value>>
       AND documenttype = <<some value>
       AND organizationid = <<some value>>
       AND organizationtype = <<some value>>
       AND revision = <<some value>>
       AND sequence = <<some value>>
       AND versionnumber = <<some value>>should use the index.
    An index is a more efficient way to access a relatively small fraction of the rows in the table. A table scan will be more efficient if you are trying to access a relatively large fraction of the rows in the table. Exactly what "small fraction" and "large fraction" means will depend on a variety of factors that the cost-based optimizer (CBO) attempts to evaluate in determing the query plan.
    Justin

  • Dynamic table in select statement

    Hi All,
    I have a requirement where i have a select option in which the input is table name , i need to use this input in my select statement and fetch entries in the table where bname is eq to ' ' or uname eq ' '.
    the challenge that i am facing is not all the tables have both the fields (uname and Bname).
    Request your help on how to code the above requirements.
    Thanks,
    Bhanu.

    Bhanu,
    I don't know what exactly is your requirement but I don't see any reason why a business user enters a table name as input in the selection screen.
    MANDT NAME                           TYPE NUMB SIGN OPTI   LOW    HIGH
    223   ZPROGNAME                       P    0001     I        EQ    XXX      ZTABLENAME
    You can maintain an entry like the above in TVARVC table and get the table name using a select query on TVARVC and then use the table as below
    SELECT SINGLE * FROM (l_tabname)
               into g_wa_tab2
               WHERE quosrc   EQ g_wa_tab1-quosrc  AND
                     quotyp   EQ g_wa_tab1-quotyp  AND
                     quotno   EQ g_wa_tab1-quotno  AND
                     quotdate EQ g_wa_tab1-quotdate.
    Funda is using TAVRVC to maintain the table names and determine the table based on a condition and the using the table in the select query.
    Thanks,
    K.Kiran.

Maybe you are looking for

  • Accessing Selected Value from Payment Terms (Item 47) in AR Invoice Form

    Hi, Have just started working in SAP Business One and SDK adn would really appreciate any help I could receive. I'm trying to access the selected value from Payment Terms field(Item 47) in the AR Invoice Form. Have successfully managed to do this aga

  • Answers for these interview Q's

    Hi BW experts, I want to know the answers for these interview Q's I faced. 1). What is the use of Nav. Attribute other than the drill down functionality in the reports. 2). What is the use of PSA?(I answered, we can update the errored records).  But,

  • Crystal Reports ActiveX Designer Failed to open document

    Yesterday I created a report in Visual Studio 2008 with about 20 subreports, each subreport containing a single aggregate query (i.e count or sum). I then saved the report file. Hours later when I attempted to reopen the report in Visual Studio I rec

  • Color/background of one page

    I want to modify somethings BUT to one and only one page (let's take the login page for example) , and i want to do the following: 1) by default of the template (i think), the background color is white, and i want to change it to black 2) how do i se

  • IPhone 3Gs - Error 1603

    I tried to update my iPhone 3Gs to iOS4. I downloaded the update from iTunes rather quickly, and it was preparing my iPhone for the update, when I got an error message 1603. I got the more details log for the message if anyone is interested in seeing