How to do without TABLES statement allowed..??

Hi all,
In OO programming many things are not allowed eg the keyword TABLES is not allowed.
The statement "SELECT-OPTIONS: kunnr FOR  vbak-kunnr." requires statement "TABLES vbak." but in OO we can't use "tables.." so how do we declare variables which are based on/similar to elements in database tables? How would we modify the select-options statement then?
Thanks,
Charles.

Worked like a charm. Note that if you use internal tables and don't have variables for some of the select-options fields you can also refer to the fields defined in the itab. However, you can't refer to the itab directly since it lacks the (deprecated) header line so you'll have to use a work area for it instead.
TYPES:
  BEGIN OF ty_vbak,
    vbeln LIKE vbak-vbeln,
    kunnr LIKE vbak-kunnr,
  END OF ty_vbak.
DATA:
    lt_vbak TYPE STANDARD TABLE OF ty_vbak,
    lwa_vbak LIKE LINE OF lt_vbak.
SELECT-OPTIONS : s_kunnr FOR lwa_vbak-kunnr.

Similar Messages

  • SAP HANA - How to run alter table statement in HANA procedure?

    I am trying to run alter table statement in a procedure. HANA gives error saying
    SAP DBTech JDBC: [257] (at 1338): sql syntax error: ALTER TABLE is not allowed in SQLScript: line 36 col 8 (at pos 1338)
    How to run alter table statements in procedure?
    Thanks,
    Suren.

    Hi Rich Heilman,
    Thanks for your response.  I have tried with dynamic SQL. I am trying to add partitions to a non portioned table.
    EXECUTE IMMEDIATE 'ALTER TABLE ' || :SCHEMA_NAME || '.TARGET_TABLE PARTITION BY RANGE (TARGET_TYPE_ID) (PARTITION VALUE = 1, PARTITION VALUE = 2, PARTITION VALUE = 3, PARTITION VALUE = 4, PARTITION OTHERS)';
    Execution fails with error
    Could not execute 'CALL PARTITION_TARGET_TABLE('SUREN_TEST')' in 1.160 seconds .
    [129]: transaction rolled back by an internal error:  [129] "SUREN_TEST"."PARTITION_TARGET_TABLE": line 53 col 3 (at pos 2173): [129] (range 3)
    Any reasons for this error?
    Thanks,
    Suren.

  • How to create a table with editable column values.

    Hi everyone,
    I think this is very simple but i'm not able to find how to do this. This is my requirement. I need to create a table with n columns and 1 row initially. user should be able to enter data into this table and click of a button should insert data into the data base table. Also there should be a button at the bottom of the table to add 1 row to the table.
    I know how to do the insert to database, but can anyone please let me know how to create a table that allows user to enter data and how to create a add 1 row button?
    Thanks in Advance!

    Raghu,
    Go through the ToolBox tutorial Create Page & Advanced table section of OAF Guide.
    Step 1 - You require to create EO & a VO based on this EO. This EO will be of DataBase table where you want to insert the data.
    Step 2 - Create a Advanced table region. (Refer this Adavanced table section for more on this)
    Step 3 - Attach this VO in the BC4J component of Adavanced Table region.
    Regards,
    Gyan

  • How to specify  tablespace for a primary key inde in create table statement

    How to specify the tablespace for a primary key index in a create table statement?
    Does the following statement is right?
    CREATE TABLE 'GPS'||TO_CHAR(SYSDATE+1,'YYYYMMDD')
                ("ID" NUMBER(10,0) NOT NULL ENABLE,
                "IP_ADDRESS" VARCHAR2(32 BYTE),
                "EQUIPMENT_ID" VARCHAR2(32 BYTE),
                "PACKET_DT" DATE,
                "PACKET" VARCHAR2(255 BYTE),
                "PACKET_FORMAT" VARCHAR2(32 BYTE),
                "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
                 CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") TABLESPACE "INDEX_DATA"
                 TABLESPACE "SBM_DATA";   Thank you
    Edited by: qkc on 09-Nov-2009 13:42

    As orafad indicated, you'll have to use the USING INDEX clause from the documentation, i.e.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE TABLE GPS
      2              ("ID" NUMBER(10,0) NOT NULL ENABLE,
      3              "IP_ADDRESS" VARCHAR2(32 BYTE),
      4              "EQUIPMENT_ID" VARCHAR2(32 BYTE),
      5              "PACKET_DT" DATE,
      6              "PACKET" VARCHAR2(255 BYTE),
      7              "PACKET_FORMAT" VARCHAR2(32 BYTE),
      8              "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
      9               CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") USING INDEX TABLESP
    ACE "USERS"
    10               )
    11*              TABLESPACE "USERS"
    SQL> /
    Table created.Justin

  • How to post a table/set of records without losing formatting while posting

    how to post a table/set of records without losing formatting while posting in this message forum. Thanks

    Most forums have a FAQ. This one is no exception.
    It is in the right hand upper corner. It's URL is http://wikis.sun.com/display/Forums/Forums+FAQ
    Sybrand Bakker
    Senior Oracle DBA

  • How can I copy tables from Numbers to Pages without formula?

    hi everyone
    i need help
    How can I copy tables from Numbers to Pages without formula in the cells?

    Ok... I see your problem... when pasting into Pages, the formulas from Numbers are included. Perhaps this is really more of a Pages question (in which case I'm far from expert). A couple of ideas:
    • In Pages, try "Edit"/"Paste and Match Style", which may insert tab delimited cell values (no formulas). Then, if you want the table format back, select these newly pasted tabbed values and use Page's "Format"/"Table"/"Convert Text to Table"/
    • In Numbers, before copying, make a temporary table of the plain values first, then copy and paste that into Pages. To do this, select the range of cells you desire in the Numbers and "Edit"/"Copy". Then "Edit"/"Deselect All" and "Edit"/"Paste Values" and "Edit"/"Cut". Now just a table of values is on the clipboard and you can head over to Pages to paste.

  • How can I use table headers only without using rows.

    how can I use table headers only, without using rows and without leaving the space.
    If anyone could say me how to paste the pic in this questions, I would have shown it.
    The flow of view is in this way
    {Table header(table on top of table)
    column header1___|| column header2__ || column header3__ ||}
    <b>Here is the blank space I am getting, How to avoid this space?this space is of one table row height</b>
    {Contents column1 || Contents column2 || Contents column3 || (This is of other table below the uper table)}
    I am using scroll for the content part of table only.
    So I am using two tables.
    I am using NW04.

    I did the possibles you explained, but couldn't get rid off the space.
    Any other solutions?
    I am keeping the header static and the content columns scrollable.
    I have used two tables one to display header above and the other to display only the contents.
    I have put the contents table in scroll container.
    And the header table in transperent container.
    Thanks and Regards,
    Hanif Kukkalli

  • Note:304522.1 How to Move Queue Tables without using export import

    Trying to use the pkg available in Metalink "Note:304522.1 How to Move Queue Tables without using export import"
    Using the 10.1.0.x and upwards Package, I'm getting the following error on a single consumer queue table with an xmltype payload:
    SQL> exec move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK');
    BEGIN move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK'); END;
    ERROR at line 1:
    ORA-20000: ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.MOVE_AQT", line 652
    ORA-06512: at line 1
    We've tried in multiple environments, always with the same results.
    Trace file shows:
    *** 2006-11-08 10:06:47.154
    *** SERVICE NAME:(SYS$USERS) 2006-11-08 10:06:47.147
    *** SESSION ID:(379.954) 2006-11-08 10:06:47.147
    qtable move procedure starting execution at 08-11-2006 10:06:47 for queue table XFORM_TEST_INT.INTERFACE_XML_QUEUE
    qtable move procedure experienced an exception at 08-11-2006 10:06:47
    qtable move error message ORA-06502: PL/SQL: numeric or value error
    qtable move procedure ended execution at 08-11-2006 10:06:47
    Can anyone help with this? Has anyone used this before successfully (or not successfully). We urgently need this working today to test moving our queue table into a tablespace with a smaller block size for performance reasons in production.
    Thanks for the help!
    Tony

    Thank you,
    Yes we've done that. They've confirmed a problem with the links/scripts on the note. The 10.1 and up version was not really 10.1 and up.
    As they would not have a new version available in time for the move we needed to perform, we switched our approach to using dbms_redefinition instead.
    Thanks for the reply,
    Tony

  • How to get the number of hits ("returned rows") in read table statement

    Hi Experts
    I have the statement shown below, which seems not to work as I would like it to. My problem is that I would like to do two different things depending on weather or not a read table statement results in 0 hits or 1 (or more) hits.
        READ TABLE g_ship_item
            WITH KEY
         l_ztknum = DATA_PACKAGE-/bic/ztknum
         BINARY SEARCH.
          IF sy-subrc is initial.
          no hits found
            DATA_PACKAGE-/BIC/ZSTAGEERR = 1.
          ELSE.
          hits where found and we will do something else...
            DATA_PACKAGE-/BIC/ZSTAGEERR = 0.
    Hope someone can help me out of my problem...
    Thanks in advance, regards
    Torben

    Hi,
    As you are using READ statement with Binary search, check whether the internal table g_ship_item is sorted with field /bic/ztknum or not. If it is not sorted then the result of this READ statement is not correct.
    Below is the correct code.
    sort  g_ship_item by /bic/ztknum.
    READ table g_ship_item with key g_ship_item = xxx.
    Thanks,
    Satya

  • How to gather table stats for tables in a different schema

    Hi All,
    I have a table present in one schema and I want to gather stats for the table in a different schema.
    I gave GRANT ALL ON SCHEMA1.T1 TO SCHEMA2;
    And when I tried to execute the command to gather stats using
    DBMS_STATS.GATHER_TABLE_STATS (OWNNAME=>'SCHMEA1',TABNAME=>'T1');
    The function is failing.
    Is there any way we can gather table stats for tables in one schema in an another schema.
    Thanks,
    MK.

    You need to grant analyze any to schema2.
    SY.

  • How to optimize this select statement  its a simple select....

    how to optimize this select statement  as the records in earlier table is abt i million
    and this simplet select statement is not executing and taking lot of time
      SELECT  guid  
                    stcts      
      INTO table gt_corcts
      FROM   corcts
      FOR all entries in gt_mege
      WHERE  /sapsll/corcts~stcts = gt_mege-ctsex
      and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.
    regards
    Arora

    Hi Arora,
    Using Package size is very simple and you can avoid the time out and as well as the problem because of memory.  Some time if you have too many records in the internal table, then you will get a short dump called TSV_TNEW_PAGE_ALLOC_FAILED.
    Below is the sample code.
    DATA p_size = 50000
    SELECT field1 field2 field3
       INTO TABLE itab1 PACKAGE SIZE p_size
       FROM dtab
       WHERE <condition>
    Other logic or process on the internal table itab1
    FREE itab1.
    ENDSELECT.
    Here the only problem is you have to put the ENDSELECT.
    How it works
    In the first select it will select 50000 records ( or the p_size you gave).  That will be in the internal table itab1.
    In the second select it will clear the 50000 records already there and append next 50000 records from the database table.
    So care should be taken to do all the logic or process with in select and endselect.
    Some ABAP standards may not allow you to use select-endselect.  But this is the best way to handle huge data without short dumps and memory related problems. 
    I am using this approach.  My data is much more huge than yours.  At an average of atleast 5 millions records per select.
    Good luck and hope this help you.
    Regards,
    Kasthuri Rangan Srinivasan

  • How can i import tables from a different schema into the existing relational model... to add these tables in the existing model? plss help

    how can i import tables from a different schema into the existing relational model... to add these tables in the existing relational/logical model? plss help
    note; I already have the relational/logical model ready from one schema... and I need to add few more tables to this relational/logical model
    can I import the same way as I did previously??
    but even if I do the same how can I add it in the model?? as the logical model has already been engineered..
    please help ...
    thanks

    Hi,
    Before you start, you should probably take a backup copy of your design (the .dmd file and associated folder), in case the update does not work out as you had hoped.
    You need to use Import > Data Dictionary again, to start the Data Dictionary Import Wizard.
    In step 1 use a suitable database connection that can access the relevant table definitions.
    In step 2 select the schema (or schemas) to import.  The "Import to" field in the lower left part of the main panel allows you to select which existing Relational Model to import into (or to specify that a new Relational Model is to be created).
    In step 3 select the tables to import.  (Note that if there are an Foreign Key constraints between the new tables and any tables you had previously imported, you should also include the previous tables, otherwise the Foreign Key constraints will not be imported.)
    After the import itself has completed, the "Compare Models" dialog is displayed.  This shows the differences between the model being imported and the previous state of the model, and allows you to select which changes are to be applied.
    Just selecting the Merge button should apply all the additions and changes in the new import.
    Having updated your Relational Model, you can then update your Logical Model.  To do this you repeat the "Engineer to Logical Model".  This displays the "Engineer to Logical Model" dialog, which shows the changes which will be applied to the Logical Model, and allows you to select which changes are to be applied.
    Just selecting the Engineer button should apply all the additions and changes.
    I hope this helps you achieve what you want.
    David

  • Create table statement from DatabaseMetaData

    Hi Experts,
    Do you know if it's possible to retrieve a create table statement based on a DatabaseMetaData ? (without looping through columnName / Type)
    The idea is to get the DatabaseMetaData from one db server, and execute the Create Table statements on a different db server.
    One obvious solution would be to loop through each table's column name/type and construct the create table statement manually, but I'd like to know whether this can be automated.
    Thanks in advnace,
    Sid

    Bigger databases provide a way to access most schema information from the database itself. That doesn't mean that the jdbc meta information is sufficient nor the best way to do that.
    There are existing tools that allow for migrations as well. Especially if the migration is a one to one mapping.

  • Stored Outlines & Restore Table Stats

    Hi all,
    I would like to know how restoring of table stats change execution plans when stored outlines are in place?
    DB version is 10.2.0.4.
    NAME                                 TYPE                             VALUE
    optimizer_dynamic_sampling           integer                          0
    optimizer_features_enable            string                           10.2.0.4
    optimizer_index_caching              integer                          0
    optimizer_index_cost_adj             integer                          65
    optimizer_mode                       string                           FIRST_ROWS_10
    optimizer_secure_view_merging        boolean                          TRUE
    query_rewrite_enabled                string                           TRUE
    star_transformation_enabled          string                           FALSE
    Following actions were done last month:
    1. dbms_stats.gather_table_stats(schema IMANAGE, Table DIT_TRUSTEE)
    2. dbms_stats.lock_table_stats(schema IMANAGE, Table DIT_TRUSTEE)
    3. Once the desired execution plan for Query 1 (e.g. sql_id=ah8nzqhyu7xh4) was in V$SQL and was used by query, I created a Stored Outline using DBMS_OUTLN.create_outline, and enabled outline by setting use_stored_outlines to the desired outline category.
    4. Every thing remained fine for almost 30-35 days
    Today, there was another query (e.g. sql_id=7anr84k12d5rt, using same DIT_TRUSTEE table) whose  query plan got changed. This query didn't have any stored outline in place and was performing without any problem earlier. So, I gathered stats for the same table (DIT_TRUSTEE) after unlocking its stats. It didn't help. So, I thought to restore old stats against which query used to perform better while also rebuilt some indexes. After the restore of table stats (DIT_TRUSTEE) to a date which was earlier than the date of creation of 1st stored outline, the execution plan of query 1 (e.g. sql_id=ah8nzqhyu7xh4) got changed. Can we know the reason why it got changed? I was under the impression that any change in stats doesn't impact the execution plan if stored outline is in place for a query. But it looked like this wasn't the case.
    It would be good if someone can explain or share their experiences.
    regards,
    Anjum

    Hi,
    The query against SQL_ID=ah8nzqhyu7xh4 is:
    SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS, imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN, imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRUSTEE.HOME_LIBRARY, imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED, imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011, imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.DIT_TRUSTEE.MODIFIED_TIME, imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015, imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME, imanage.DIT_TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID, imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME, imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUSTEE.UID_F21024, imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID, imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.S_CCSSBL_LBRRY_LST_NHRT_F60326, imanage.DIT_TRUSTEE.NAME_FIRST, imanage.DIT_TRUSTEE.NAME_MIDDLE, imanage.DIT_TRUSTEE.NAME_LAST, imanage.DIT_TRUSTEE.NAME_FULL, imanage.DIT_TRUSTEE.NAME_SUFFIX, imanage.DIT_TRUSTEE.NAME_SALUTATION, imanage.DIT_TRUSTEE.GENDER, imanage.DIT_TRUSTEE.JOB_TITLE, imanage.DIT_TRUSTEE.ANNIVERSARY, imanage.DIT_TRUSTEE.BIRTHDATE, imanage.DIT_TRUSTEE.ASSISTANT_RSID, imanage.DIT_TRUSTEE.LOCALE_LANGUAGE, imanage.DIT_TRUSTEE.LOCALE_COUNTRY, imanage.DIT_TRUSTEE.LOCALE_TIMEZONE, imanage.DIT_TRUSTEE.EMAIL_1, imanage.DIT_TRUSTEE.EMAIL_2, imanage.DIT_TRUSTEE.EMAIL_3, imanage.DIT_TRUSTEE.EMAIL_FORMAT_1, imanage.DIT_TRUSTEE.EMAIL_FORMAT_2, imanage.DIT_TRUSTEE.EMAIL_FORMAT_3, imanage.DIT_TRUSTEE.IM_ID, imanage.DIT_TRUSTEE.PHONE_HOME, imanage.DIT_TRUSTEE.PHONE_BUSINESS, imanage.DIT_TRUSTEE.PHONE_MOBILE, imanage.DIT_TRUSTEE.PHONE_PAGER, imanage.DIT_TRUSTEE.PHONE_OTHER, imanage.DIT_TRUSTEE.FAX_HOME, imanage.DIT_TRUSTEE.FAX_BUSINESS, imanage.DIT_TRUSTEE.FAX_OTHER, imanage.DIT_TRUSTEE.MAILING_ADDRESS, imanage.DIT_TRUSTEE.BA_DEPARTMENT, imanage.DIT_TRUSTEE.BA_LOCATION, imanage.DIT_TRUSTEE.BA_COMPANY, imanage.DIT_TRUSTEE.BA_STREET_1, imanage.DIT_TRUSTEE.BA_STREET_2, imanage.DIT_TRUSTEE.BA_POBOX, imanage.DIT_TRUSTEE.BA_CITY, imanage.DIT_TRUSTEE.BA_STATE, imanage.DIT_TRUSTEE.BA_COUNTRY, imanage.DIT_TRUSTEE.BA_POSTAL_CODE, imanage.DIT_TRUSTEE.HA_STREET_1, imanage.DIT_TRUSTEE.HA_STREET_2, imanage.DIT_TRUSTEE.HA_POBOX, imanage.DIT_TRUSTEE.HA_CITY, imanage.DIT_TRUSTEE.HA_STATE, imanage.DIT_TRUSTEE.HA_COUNTRY, imanage.DIT_TRUSTEE.HA_POSTAL_CODE, imanage.DIT_TRUSTEE.WP_HOME, imanage.DIT_TRUSTEE.WP_BUSINESS, imanage.DIT_TRUSTEE.WP_OTHER, imanage.DIT_TRUSTEE.NE_DELIVERY_MODE_IMMEDIATE, imanage.DIT_TRUSTEE.NE_DELIVERY_MODE_SUMMARY, imanage.DIT_TRUSTEE.NE_USER_PREFERENCE, imanage.DIT_TRUSTEE.NE_USER_SUMMARY_TIME, imanage.DIT_TRUSTEE.NE_COPY_TO_ASSISTANT, imanage.DIT_TRUSTEE.IS_EXTERNAL, imanage.DIT_TRUSTEE.IS_IS_EXTERNAL_INHERITED, imanage.DIT_TRUSTEE.NOTES, imanage.DIT_TRUSTEE.LOCATION_RSID, imanage.DIT_TRUSTEE.IS_ALL_IP_VALID, imanage.DIT_TRUSTEE.LAST_LOGON_TIME, imanage.DIT_TRUSTEE.S_HM_PG_WRKSPC_NHR_F4294966291, imanage.DIT_TRUSTEE.S_PRFRNCS_FCLTY_NH_F4294966292, imanage.DIT_TRUSTEE.HOME_PAGE_WORKSPACE, imanage.DIT_TRUSTEE.PREFERENCES_FACILITY, imanage.DIT_TRUSTEE.P_NEW_ITEM_INDICATOR, imanage.DIT_TRUSTEE.P_PWD_QUESTION, imanage.DIT_TRUSTEE.P_PWD_ANSWER, imanage.DIT_TRUSTEE.X_ECF_USER, imanage.DIT_TRUSTEE.X_DEPARTMENTS, imanage.DIT_TRUSTEE.X_TP_CLASSIFICATION, imanage.DIT_TRUSTEE.X_IMR_ENABLED_TIME, imanage.DIT_TRUSTEE.X_CAN_MANAGE_COI, imanage.DIT_TRUSTEE.X_CAN_ADD_THIRD_PARTY, imanage.DIT_TRUSTEE.X_IS_SECURITY_ADMINISTRATOR, imanage.DIT_TRUSTEE.X_IS_A_AND_S_DIRECT_LOAD, imanage.DIT_TRUSTEE.X_IS_ECF_DIRECT_LOAD, imanage.DIT_TRUSTEE.X_IS_NATIVE_REPOSITORY, imanage.DIT_TRUSTEE.X_CLIENT_CATEGORY, imanage.DIT_TRUSTEE.X_IS_ECF2_USER, imanage.DIT_TRUSTEE.X_IS_ECF2_ADMIN, imanage.DIT_TRUSTEE.X_CWS_UNIT, imanage.DIT_TRUSTEE.X_XCHANGING_ID, imanage.DIT_TRUSTEE.X_IS_DOCUMENT_FILE_VIEWER, imanage.DIT_TRUSTEE.X_IS_CWS_USER
    FROM imanage.DIT_TRUSTEE
    WHERE ((imanage.DIT_TRUSTEE.WORKSPACE_RSID = :"SYS_B_0") AND (UPPER(imanage.DIT_TRUSTEE.RDN) = :1)) ORDER BY imanage.DIT_TRUSTEE.NAME_FIRST ASC, imanage.DIT_TRUSTEE.NAME_LAST ASC, imanage.DIT_TRUSTEE.UID_F21024 ASC, imanage.DIT_TRUSTEE.RDN ASC
    which shows the bind vars in place.
    while definition of index IX_DIT_TRUSTEE_6 is:
    CREATE INDEX "IMANAGE"."IX_DIT_TRUSTEE_6" ON "IMANAGE"."DIT_TRUSTEE" ("WORKSPACE_RSID", "DIT_CLASS", "SID") TABLESPACE "REPOS_INDX" PCTFREE 10INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 512K BUFFER_POOL DEFAULT) LOGGING LOCAL
    Now, I below details explaining the index it started using despite outline in place:
    SQL> select sql_id, HASH_VALUE, CHILD_NUMBER, users_executing from v$sql where PLAN_HASH_VALUE=2563299851;
    SQL_ID        HASH_VALUE CHILD_NUMBER USERS_EXECUTING
    ah8nzqhyu7xh4 1034155524            1               0
    SQL> SELECT hash_value, child_number, sql_text FROM v$sql WHERE sql_id='ah8nzqhyu7xh4';
    HASH_VALUE CHILD_NUMBER
    SQL_TEXT
    1034155524            1
    SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS, imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN, imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRU
    STEE.HOME_LIBRARY, imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED, imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011, imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.D
    IT_TRUSTEE.MODIFIED_TIME, imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015, imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME, imanage.DIT
    _TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID, imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME, imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUS
    TEE.UID_F21024, imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID, imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED, imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DI
    SQL> SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR('ah8nzqhyu7xh4',1));
    PLAN_TABLE_OUTPUT
    SQL_ID  ah8nzqhyu7xh4, child number 1
    SELECT imanage.DIT_TRUSTEE.CREATED_TIME, imanage.DIT_TRUSTEE.DIT_CLASS,
    imanage.DIT_TRUSTEE.DOES_PASSWORD_EXPIRE, imanage.DIT_TRUSTEE.DOMAIN,
    imanage.DIT_TRUSTEE.FORCE_PASSWORD_CHANGE, imanage.DIT_TRUSTEE.HOME_LIBRARY,
    imanage.DIT_TRUSTEE.IS_DELETED, imanage.DIT_TRUSTEE.IS_ENABLED,
    imanage.DIT_TRUSTEE.IS_LEAF_NODE, imanage.DIT_TRUSTEE.LABEL_F21011,
    imanage.DIT_TRUSTEE.LOGIN_LOCKOUT_TIME, imanage.DIT_TRUSTEE.MODIFIED_TIME,
    imanage.DIT_TRUSTEE.PARENT_TRUSTEE_RSID, imanage.DIT_TRUSTEE.PASSWORD_F21015,
    imanage.DIT_TRUSTEE.PASSWORD_FAIL_COUNT, imanage.DIT_TRUSTEE.PASSWORD_MODIFIED_TIME,
    imanage.DIT_TRUSTEE.RDN, imanage.DIT_TRUSTEE.REPLICATION_ID, imanage.DIT_TRUSTEE.SID,
    imanage.DIT_TRUSTEE.SYNCHRONIZE_ID, imanage.DIT_TRUSTEE.SYNCHRONIZED_TIME,
    imanage.DIT_TRUSTEE.TRUSTEE_TYPE, imanage.DIT_TRUSTEE.UID_F21024,
    imanage.DIT_TRUSTEE.WORKSPACE_LIBRARY, imanage.DIT_TRUSTEE.WORKSPACE_RSID,
    imanage.DIT_TRUSTEE.IS_WORKSPACE_LIBRARY_INHERITED,
    imanage.DIT_TRUSTEE.IS_HOME_LIBRARY_INHERITED, imanage.DI
    Plan hash value: 2563299851
    | Id  | Operation                    | Name                 | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                      |       |       |     4 (100)|          |
    |   1 |  SORT ORDER BY               |                      |     1 |   248 |     4  (25)| 00:00:01 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| DIT_TRUSTEE          |     1 |   248 |     3   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN          | DIT_TRUSTEE_TST1_IDX |     1 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("DIT_TRUSTEE"."WORKSPACE_RSID"=:SYS_B_0)
       3 - access("DIT_TRUSTEE"."SYS_NC00096$"=:1)
    Note
       - outline "SYS_OUTLINE_13100417531513606" used for this statement
    38 rows selected.
    Definition of index DIT_TRUSTEE_TST1_IDX is:
    CREATE INDEX "IMANAGE"."DIT_TRUSTEE_TST1_IDX" ON "IMANAGE"."DIT_TRUSTEE" (UPPER("RDN")) TABLESPACE "REPOS_INDX" PCTFREE 10 INITRANS 2 MAXTRANS 255STORAGE ( INITIAL 512K BUFFER_POOL DEFAULT) LOGGING LOCAL
    I didnt want the query to use index DIT_TRUSTEE_TST1_IDX as it performs bad for the customer as compare to index IX_DIT_TRUSTEE_6
    The question arises here is that can we force an index to be used as part of stored outline because when we created outline, it was using index IX_DIT_TRUSTEE_6.

  • How to join two tables

    hi
    how to join two tables using inner join  if the first table has two primary keys and second table has 3 primary keys

    Would describe type of joins in ABAP, which might differ with other joins.
    The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of INNER JOIN or LEFT OUTER JOIN. Depending on the type of join, a join expression can be either an inner (INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering.
    On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM.
    AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names.
    The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences:
    At least one comparison must be specified after ON.
    Individual comparisons may be joined using AND only.
    All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand.
    The following additions not be used: NOT, LIKE, IN.
    No sub-queries may be used.
    For outer joins, only equality comparisons (=, EQ) are possible.
    If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side.
    In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands.
    Resulting set for inner join
    The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set.
    Resulting set for outer join
    The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values.
    Note
    If the same column name occurs in several database tables in a join expression, they have to be identified in all remaining additions of the SELECT statement by using the column selector ~.
    Example
    Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table.
    PARAMETERS: p_cityfr TYPE spfli-cityfrom,
    p_cityto TYPE spfli-cityto.
    DATA: BEGIN OF wa,
    fldate TYPE sflight-fldate,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa.
    DATA itab LIKE SORTED TABLE OF wa
    WITH UNIQUE KEY fldate carrname connid.
    SELECT ccarrname pconnid f~fldate
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM ( ( scarr AS c
    INNER JOIN spfli AS p ON pcarrid = ccarrid
    AND p~cityfrom = p_cityfr
    AND p~cityto = p_cityto )
    INNER JOIN sflight AS f ON fcarrid = pcarrid
    AND fconnid = pconnid ).
    LOOP AT itab INTO wa.
    WRITE: / wa-fldate, wa-carrname, wa-connid.
    ENDLOOP.
    Example
    Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
    PARAMETERS p_cityfr TYPE spfli-cityfrom.
    DATA: BEGIN OF wa,
    carrid TYPE scarr-carrid,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa,
    itab LIKE SORTED TABLE OF wa
    WITH NON-UNIQUE KEY carrid.
    SELECT scarrid scarrname p~connid
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM scarr AS s
    LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid
    AND p~cityfrom = p_cityfr.
    LOOP AT itab INTO wa.
    IF wa-connid = '0000'.
    WRITE: / wa-carrid, wa-carrname.
    ENDIF.
    ENDLOOP.

Maybe you are looking for

  • What's Wrong With Safari 4? I Need An Answer...

    The menu bar (file, edit...etc) except for Develop all say 'localized string not found'. Everytime a page loads it says the same thing. I just removed the menu bar, cause I didn't know what everything is. Is it just my computer or is everyone else wh

  • Curve 9320 : lost "access point option"

    Hi ! First sorry for my bad englis... i'm from france, an there is no blackberry support here. Yesterday i configured my Curve 9320 to use it as a wifi access point. It did word perfectly untill this morning. As told in user manual, it juste disconne

  • Error during multilevel controlling

    I am trying to perform a multilevel controlling. After marking flag to transfer I am getting the following error: "There is no internal order for project xxxxxxxx". The WBS element is also not created. I am using auto mode for multilevel controlling.

  • Do I have to uninstall internet explorer before I install firefox?

    I have been having so many problems with my Internet Explorer freezing up on me...I'm getting those annoying hour glass icons especially when I'm on facebook....

  • Configuration-Pool Asset Management

    What is the purpose of configuring PAM class for pool asset management?How these characteristics are helpful during raising demand notificaiton for pool asset? Where I can get the building block for pool asset management? Regards, Tehsin