Add an index to a DB table without modification?

I have a database table in the SAP namespace, and I would like to add one or two indices to the table (non unique database index). This is not possible without modifying the table, right?

Hi Daniel,
No it wouldnt be a modification to the table but you should first analyze the impact of the index since its not advisable to create index always.
refer the below link:-
[Create index in standard table;
[What to Keep in Mind for Secondary Indexes|http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm]
Regards
Abhii
Edited by: Abhii on Sep 1, 2010 3:49 PM

Similar Messages

  • Add / Delete a row in a table without using a button

    Hi,
    I was just wondering if it was possible to remove or add a row in a table without using the button?  I noticed that in all examples, it always involve putting code in the button click event but I wanted to add or delete a row in a table based on the fact if the row contains a certain value or not.  Is that possible?
    Much appreciated,
    Vincent

    Vincent,
         Here is the updated file..
    https://acrobat.com/#d=bVDBNM0pnS2IpfE58V01Tg
    You have checked the checkbox "Repeat subform for each Row" for Header Row under IndTable1. You need to do at Row1 level of Table1.
    I bound the Row1 of Table1 to <Row1> tag in your XML which can repeat multiple times.
    I wrote the code in the Doc Ready event of the Test1 field to check whether the value is existing or not. If it does not have a value, then I am removing the instance of the Row1 by passing the current index.. (You can check the code)..
    While creating a data connection using XML you need to make sure that the below structure is repeated atleast 2 times. And while previewing you can use make a copy of this same XML and remove Row1.
      <Row1>
        <Test1>Individual Name 1</Test1>
      </Row1>
    Thanks
    Srini

  • Add a new record in database table without using table maintance generator

    Hi Expart ,
                  Plz. tell me how to add new record in database table without using table maintance ganerator ....give me one ex.
    Regards
    Bhabani

    Hi,
    The other way to safely handle the modification of tables is through is by programs that can be done with SE38 or SE80.
    To insert into database table we use INSERT statement :
    1. To insert a single line into a database table, use the following:
    INSERT INTO <target> VALUES <wa>.
    INSERT <target> FROM <wa>.
    2. To insert a several lines into a database table, use the following:
    INSERT <target> FROM TABLE <itaba>.
    Or even we can use MODIFY statementas this single statement is used to insert as well as update the records of database table.
    MODIFY <target> FROM <wa>.
    or MODIFY <target> FROM TABLE <itab>.
    thanx.
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:25 PM
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:30 PM

  • Add/Update Indexes Rates via DI, table:ORTT

    Hello,
    The SBObob object contains function: SetCurrencyRates - add/update currencies rate.
    I need to to the same, but with indexses
    Does anyone know how to do this?
    thanks
    Tam
    Edited by: YECHIEL SCHUSSEIM on Mar 16, 2010 11:53 AM

    Ok, i will try to explain better:
    The ORTT table contains values for Exchange rates and indexses:
    the "currency" field contains key from OIDX table or  OCRN table.
    When i use the function: SBObob.SetCurrencyRates  to insert value whith key from OCRN table, it's works well.
    But when I tried to insert value whith key from OIDX table, i got the Error:"Invalid Currency"
    thanks for your help
    tami

  • Create a new row in a table without using add new row button

    I want to add a new row to the table without using the add new row button of the table. I'm not able to display default row in the table. Though if click on apply the record appears after saving in the database. Any thoughts how to implement this functionality.

    Here is what you have to do.
    1) You have to handle this in processRequest()
    2) In the AM code , u need to check if there is already a row exisit or vo is blank
    if (vo.getFetchedRowCount() == 0)
    // first time
    vo.setMaxFetchSize(0); // THIS IS REQUIRED.
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    else
    //If already rows are there then you suppose to insert in the end
    // i assume you would have execute your vo
    YourVORowImpl row= (YourVORowImpl)vo.getRowAtRangeIndex(0);
    vo2.insertRowAtRangeIndex();
    It should work.

  • Adding fields to an existing table without dropping it

    Hi Guys,
    Just wondering if anyone can tell me if it's possible to write an SQL statement to add extra fields to an existing table without dropping it then re-creating and also what SQL would be needed. The added fields will be part of an exclusive arc, so can contain NULL values.
    Any help would be much appreciated.
    Anton

    Hi,
    You can Use the ALTER TABLE statment.
    like consider emp table having 3 columns empno,enmae,deptno.
    now u want to add sal and mgr columns.
    u can do it like this
    ALTER TABLE ADD ((sal NUMBER(5,2),(mgr NUMBER));
    If u want to modify the column datatype
    u can use ALTER TABLE MODIFY (<column datatype>............);
    Trinath Somanchi,
    Hyderabad.

  • Tables without unique index

    Hi,
    I am getting following warnings in db02:
    Tables without unique index
    STATS_RFC
    STATS_RFC_OLD.
    In se16 the status sows Table STATS_RFC_OLD\ STATS_RFC  is not active in the Dictionary. In se11 does not exist.
    Kindly suggest.
    Regards,
    Rahul.

    HI,
    desc SAPR3P.STATS_RFC
    Name                                      Null?    Type
    STATID                                             VARCHAR2(30)
    TYPE                                               CHAR(1)
    VERSION                                            NUMBER
    FLAGS                                              NUMBER
    C1                                                 VARCHAR2(30)
    C2                                                 VARCHAR2(30)
    C3                                                 VARCHAR2(30)
    C4                                                 VARCHAR2(30)
    C5                                                 VARCHAR2(30)
    N1                                                 NUMBER
    N2                                                 NUMBER
    N3                                                 NUMBER
    N4                                                 NUMBER
    N5                                                 NUMBER
    N6                                                 NUMBER
    N7                                                 NUMBER
    N8                                                 NUMBER
    N9                                                 NUMBER
    N10                                                NUMBER
    N11                                                NUMBER
    N12                                                NUMBER
    D1                                                 DATE
    R1                                                 RAW(32)
    R2                                                 RAW(32)
    CH1                                                VARCHAR2(1000)
    No fields in STATS_RFC_OLD.
    Regards,
    Rahul.

  • Large tables without clustered indexes -- a bad idea, or ok?

    We have several large tables that don't have clustered indexes, but do have primary keys and assorted other indexes. We're seeing issues that look like they are related to statistics even though there is a nightly update statistics job.
    So my question is, does the existence of a clustered index impact other indexes or the update statistics process? Are our tables ok the way they are?
    Adding clustered indexes would be a big project for non-development-related reasons so I would need to have good reasons to advocate for this.

    RSingh,
    "By default" is a confusing word here. If you do it with WIZARD, I agree. But with T-SQL,there is no space for by default, it can be anything.
    I agree that I assumed here as I wont do much things with wizard. :)
    Try the below:
    --Here by default, its non-clustered
    create table Test_table(Col1 int , Col2 int not null )
    Create clustered index IX__Test_Table on Test_Table (Col1)
    Alter table test_Table
    Add Constraint PK_testTable
    Primary Key (Col2);
    Drop table test_table
    --Here by default, its clustered
    create table Test_table(Col1 int , Col2 int not null Primary key)
    Create index IX__Test_Table on Test_Table (Col1)
    Drop table test_table
    Neither the word "By Default" is a confusing word nor it happens only in WIZARD. Let me clarify below. I said "When a primary key constraint is created it creates a unique clustered index by default". Run the below DDL and check whether
    a clustered index is created or not. i.e
    CREATE TABLE Persons
    P_Id int NOT NULL,
    LastName varchar(255) NOT NULL,
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255),
    CONSTRAINT pk_PersonID PRIMARY KEY (P_Id,LastName)
    Regards, RSingh
    That did not really make any sense to my context as I am NOT against that it will create Clustered index, In fact, my code says the same. My point is only "By default" is confusing. 
    Let me explain, what I mean "By default"....
    Create index IX_Indexname on Tablename(Colname)
    The above will create "non clustered index" BY DEFAULT. Any situation, the above would create only non-clustered irrespective of other indexes present in the table.
    Hope the above is clear. May be its my way looking at "BY DEFAULT".

  • Does ADF Business Components  work well with tables without primary Key?

    We have tables using unique index without primary key. Can ADF Business Components relate business objects based on the unique index columns of the tables?

    Hi,
    Regarding my question about the XML syntax for custom properties:
    It turned out to be another problem in the Entity object definition that caused the JDeveloper error. Other entities let me add the custom property without problems. However should anybody ever need that XML syntax, here's how you add a custom property to an entity definition in the XML code:
      <Attribute
        Name="Id"
        IsNotNull="true"
        Precision="10"
        Scale="0"
        ColumnName="ID"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        SQLType="NUMERIC"
        TableName="TABLE"
        PrimaryKey="true">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="22"/>
        </DesignTime>
        <Properties>
          <CustomProperties>
            <Property
              Name="SequenceName"
              Value="SEQ1"/>
          </CustomProperties>
        </Properties>   
      </Attribute>Best regards,
    Bart Kummel
    Edited by: Bart Kummel on Sep 8, 2009 1:14 PM

  • Index usage for retrieving data  without filter predicate

    Hi,
    does someone have a explanation for the following scenario:
    I have a table T1 with an index OID_IX on column ( object_id ) - The table is a CTAS from dba_objects just to populate it with data.
    There are no other Indexes present. The table and the index are analyzed !
    When I run the following query the table is accessed FULL ( not using the index )
    SELECT OBJECT_ID FROM T1;
    SQL> select object_id from t1;
    485984 rows selected.
    Elapsed: 00:00:01.76
    Execution Plan
    Plan hash value: 3617692013
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 485K| 2372K| 1528 (1)| 00:00:19 |
    | 1 | TABLE ACCESS FULL| T1 | 485K| 2372K| 1528 (1)| 00:00:19 |
    Statistics
    1 recursive calls
    0 db block gets
    7396 consistent gets
    0 physical reads
    0 redo size
    2887158 bytes sent via SQL*Net to client
    5684 bytes received via SQL*Net from client
    487 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    485984 rows processed
    But if I add a predicate ( even though it is useless in this case ) the index is taken and the query runs faster:
    JDBC@toekb> select object_id from t1 where object_id != -999;
    485960 rows selected.
    Elapsed: 00:00:01.40
    Execution Plan
    Plan hash value: 3555700789
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 485K| 2372K| 242 (3)| 00:00:03 |
    |* 1 | INDEX FAST FULL SCAN| OID_IX | 485K| 2372K| 242 (3)| 00:00:03 |
    Predicate Information (identified by operation id):
    1 - filter("OBJECT_ID"<>(-999))
    Statistics
    1 recursive calls
    0 db block gets
    1571 consistent gets
    0 physical reads
    0 redo size
    2766124 bytes sent via SQL*Net to client
    5684 bytes received via SQL*Net from client
    487 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    485960 rows processed
    here my setup:
    sqlsql--
    drop table t1 purge ;
    create table t1 tablespace users as select * from dba_objects;
    insert into t1 ( select * from t1);
    commit;
    insert into t1 ( select * from t1);
    commit;
    insert into t1 ( select * from t1);
    commit;
    create index oid_ix on t1 (object_id) tablespace users ;
    exec dbms_stats.gather_table_stats(null,'t1',cascade=>true, estimate_percent=>100);
    sqlsql--
    In my case the Table and Index looks this way:
    JDBC@toekb> select table_name, NUM_ROWS,BLOCKS,AVG_SPACE from user_tables;
    TABLE_NAME NUM_ROWS BLOCKS AVG_SPACE
    =======================================
    T1 485984 6944 0
    Elapsed: 00:00:00.11
    JDBC@toekb> select INDEX_NAME,BLEVEL,LEAF_BLOCKS,DISTINCT_KEYS,NUM_ROWS from user_indexes;
    INDEX_NAME BLEVEL LEAF_BLOCKS DISTINCT_KEYS NUM_ROWS
    ===================================================
    OID_IX 2 1074 60745 485960
    Elapsed: 00:00:00.07
    The table holds 7 times more blocks than the index !
    any reply welcome
    best regards
    Edited by: guenterp on Aug 12, 2010 2:44 PM

    guenterp wrote:
    Hi,
    does someone have a explanation for the following scenario:
    I have a table T1 with an index OID_IX on column ( object_id ) - The table is a CTAS from dba_objects just to populate it with data.
    There are no other Indexes present. The table and the index are analyzed !
    When I run the following query the table is accessed FULL ( not using the index )
    SELECT OBJECT_ID FROM T1;
    SQL> select object_id from t1;
    485984 rows selected.
    Elapsed: 00:00:01.76
    Execution Plan
    Plan hash value: 3617692013
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 485K| 2372K| 1528 (1)| 00:00:19 |
    | 1 | TABLE ACCESS FULL| T1 | 485K| 2372K| 1528 (1)| 00:00:19 |
    Statistics
    1 recursive calls
    0 db block gets
    7396 consistent gets
    0 physical reads
    0 redo size
    2887158 bytes sent via SQL*Net to client
    5684 bytes received via SQL*Net from client
    487 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    485984 rows processed
    But if I add a predicate ( even though it is useless in this case ) the index is taken and the query runs faster:
    JDBC@toekb> select object_id from t1 where object_id != -999;
    485960 rows selected.
    Elapsed: 00:00:01.40
    Execution Plan
    Plan hash value: 3555700789
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 485K| 2372K| 242 (3)| 00:00:03 |
    |* 1 | INDEX FAST FULL SCAN| OID_IX | 485K| 2372K| 242 (3)| 00:00:03 |
    Predicate Information (identified by operation id):
    1 - filter("OBJECT_ID"<>(-999))
    Statistics
    1 recursive calls
    0 db block gets
    1571 consistent gets
    0 physical reads
    0 redo size
    2766124 bytes sent via SQL*Net to client
    5684 bytes received via SQL*Net from client
    487 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    485960 rows processed
    here my setup:
    sqlsql--
    drop table t1 purge ;
    create table t1 tablespace users as select * from dba_objects;
    insert into t1 ( select * from t1);
    commit;
    insert into t1 ( select * from t1);
    commit;
    insert into t1 ( select * from t1);
    commit;
    create index oid_ix on t1 (object_id) tablespace users ;
    exec dbms_stats.gather_table_stats(null,'t1',cascade=>true, estimate_percent=>100);
    sqlsql--
    In my case the Table and Index looks this way:
    JDBC@toekb> select table_name, NUM_ROWS,BLOCKS,AVG_SPACE from user_tables;
    TABLE_NAME NUM_ROWS BLOCKS AVG_SPACE
    =======================================
    T1 485984 6944 0
    Elapsed: 00:00:00.11
    JDBC@toekb> select INDEX_NAME,BLEVEL,LEAF_BLOCKS,DISTINCT_KEYS,NUM_ROWS from user_indexes;
    INDEX_NAME BLEVEL LEAF_BLOCKS DISTINCT_KEYS NUM_ROWS
    ===================================================
    OID_IX 2 1074 60745 485960
    Elapsed: 00:00:00.07
    The table holds 7 times more blocks than the index !
    any reply welcome
    best regards
    Edited by: guenterp on Aug 12, 2010 2:44 PMSorry, but I am in doubt with your statists:
    Statistics
    1 recursive calls
    0 db block gets
    7396 consistent gets
    0 physical reads ---->>>>>>>>>>>> Why it is 0 in any case(bnoth full scan and index FFS)
    0 redo size
    2887158 bytes sent via SQL*Net to client
    5684 bytes received via SQL*Net from client
    487 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    485984 rows processedCould you pls retry below operation before execuion of each sql:
    alter system flush buffer_cache;In my case with 10.2.0.4 on HPUX:
    SQL> exec dbms_stats.gather_table_stats(null,'t1',cascade=>true, estimate_percent=>100);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.61
    SQL> alter system flush buffer_cache;
    System altered.
    Elapsed: 00:00:14.00
    SQL> select * from t1;
    82016 rows selected.
    Elapsed: 00:00:06.48
    Execution Plan
    Plan hash value: 838529891
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 82016 |  6888K|   394   (1)| 00:00:05 |
    |   1 |  TABLE ACCESS FULL| T1   | 82016 |  6888K|   394   (1)| 00:00:05 |
    Statistics
              0  recursive calls
              0  db block gets
           6455  consistent gets
           1039  physical reads
              0  redo size
        3480570  bytes sent via SQL*Net to client
          38508  bytes received via SQL*Net from client
           5469  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          82016  rows processed
    SQL> alter system flush buffer_cache;
    System altered.
    Elapsed: 00:00:18.26
    SQL> select * from t1 where object_id !=999;
    81976 rows selected.
    Elapsed: 00:00:07.09
    Execution Plan
    Plan hash value: 838529891
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 81976 |  6884K|   394   (1)| 00:00:05 |
    |*  1 |  TABLE ACCESS FULL| T1   | 81976 |  6884K|   394   (1)| 00:00:05 |
    Predicate Information (identified by operation id):
       1 - filter("OBJECT_ID"<>999)
    Statistics
              0  recursive calls
              0  db block gets
           6443  consistent gets
           1039  physical reads
              0  redo size
        3478961  bytes sent via SQL*Net to client
          38494  bytes received via SQL*Net from client
           5467  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          81976  rows processed
    SQL>

  • Can we change the fields of database unique index in a customised table?

    Hi all..
    I want to know that can we create or change or delete the database unique index of a customized table?
    In my case, there is a customised table with 4 primary keys with all the records to be maintained thru transaction code SM30.
    There is database unique index maintained for this table which has 2 fields. These 2 fields are out of the 4 primary fields of the table.I hope I have made myself clear!
    Now when I am trying to insert a record in the table it give me a short dump.( It says duplication of records is not allowed)
    The reason being that the new record that I am trying to insert in the database table has those 2 fields for which the unique index is maintained is the same as an already existing record.And the other two fields are different from the already existing record.So overall the combination of the 4 primary fields is different.
    Please tell me how shall I proceed now?
    I also tried to change the Unique index but it is asking me some kind of authrization(You are not authorized to make changes (authorization object S_DEVELOP)).Also I am not sure whether changing the unique index is feasible or not.?
    Thanks.

    hi
    I think you will not be able to do unique indexing withou the help of primary keys,so use all the primary keys into the table field selections  and and then create indexing otherwise dupilication of keys can occur. if you are not able to keep the primary keys then go for non unique key indexing,where you have to add the client field and the any keys of your wish.

  • Add button to shipment dynpro vt02n without modification

    Hi all,
    is it possible to add a button (or someting else) into shipment transaction vt02n subdynpro 1030 (or any other subdynpro) without modification. In material master data it is possible over customizing. Is this possible in shipments, too?
    Thanks Max

    Hi Madhu,
    Can you provide me more details on what to do with my situation?
    I already have the program which is SAPMV56A but I don't know what to do after. Also can you tell me where I can find (table) the items on the Trans. Type list?
    Thanks,
    Eric

  • How to add an index to a materialized view in Data Modeler 3.3

    Hello everyone,
    I'm looking for a how-to to add an index to a materialized view in Data Modeler 3.3.0.747, as I coudn't find a way to do it so far.
    I looked here:
    Relational Model
    Physical Model
    Oracle 11g
    Materialized Views
    "my_mv_name"
    "INDEXES" IS NOT HERE IN THE TREE
    "Tables" does not include it either
    Thank you & Best regards,
    Blama

    Hi David,
    thanks a lot. I did so and it worked, but I found a minor bug while doing so:
    I marked the table as "Implement as Materialized View" and went to File->Export->DDL (for Oracle 11g).
    The generated code (I checked all options in "Drop Selection") includes a row:
    DROP MATERIALIZED VIEW mv_mymatview CASCADE CONSTRAINTS ;
    which produces a syntax error.
    Best regards,
    Blama

  • Creation of condition table without copy

    During creation of Condition table ( without copying any condition from available tables), Is it possible to see all field catalouges available? and if possible then how can we see all fields available to add desired ones into our table?

    Hi,
    SPRO >Sales and Distribution->Basic Functions>Pricing>Pricing Control-->Define Condition Tables
    In the above menu path you can find out the Field catalog what SAP has given if you want to add new field you can add provided
    If you done the Enhancements
    Regards,
    Prasanna

  • Errors creating indexes on Binary XML Tables

    Hi,
    Oracle details are as follows:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I'm currently having an issue when attempting to create a suitable index on a binary xml table. I have a Binary xml table that stores a number of xml documents. I have created an index on this table as follows:
    create index TEST_WQI_idx_1 on TEST_WEB_QUOTE_INDX1(OBJECT_VALUE)
    INDEXTYPE IS XDB.XMLINDEX
    PARAMETERS ('PATHS (INCLUDE
    (/webPolicy/QuoteId))');
    Querying the table with the following:
    SQL> l
    1 select xmlcast(xmlquery('/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    2 as number) "VERSION",
    3 xmlcast(xmlquery('/webPolicy/QuoteId/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    4 as number) "QUOTEID"
    5 FROM TEST_WEB_QUOTE_INDX1
    6 where xmlcast(xmlquery('/webPolicy/QuoteId/text()' PASSING OBJECT_VALUE RETURNING CONTENT)
    7* as number) = 22824
    SQL> /
    VERSION QUOTEID
    1 22824
    Execution Plan
    Plan hash value: 3559428808
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 545 | 1071K| 1030 (1)| 00:00:19 |
    | 1 | SORT AGGREGATE | | 1 | 3022 | | |
    |* 2 | TABLE ACCESS BY INDEX ROWID | SYS895336_TEST_WQI__PATH_TABLE | 1 | 3022 | 2 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | SYS895336_TEST_WQI__PIKEY_IX | 1 | | 1 (0)| 00:00:01 |
    |* 4 | FILTER | | | | | |
    | 5 | TABLE ACCESS FULL | TEST_WEB_QUOTE_INDX1 | 545 | 1071K| 4 (0)| 00:00:01 |
    | 6 | SORT AGGREGATE | | 1 | 3022 | | |
    |* 7 | TABLE ACCESS BY INDEX ROWID| SYS895336_TEST_WQI__PATH_TABLE | 1 | 3022 | 2 (0)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN | SYS895336_TEST_WQI__PIKEY_IX | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter(SYS_XMLI_LOC_ISTEXT("SYS_P0"."LOCATOR","SYS_P0"."PATHID")=1)
    3 - access("SYS_P0"."RID"=:B1 AND "SYS_P0"."PATHID"=HEXTORAW('5E6C') )
    4 - filter(CAST( (SELECT "SYS"."STRAGG"("SYS_P2"."VALUE") FROM
    "WEB_STAGING"."SYS895336_TEST_WQI__PATH_TABLE" "SYS_P2" WHERE "SYS_P2"."PATHID"=HEXTORAW('5E6C') AND
    "SYS_P2"."RID"=:B1 AND SYS_XMLI_LOC_ISTEXT("SYS_P2"."LOCATOR","SYS_P2"."PATHID")=1) AS number)=22824)
    7 - filter(SYS_XMLI_LOC_ISTEXT("SYS_P2"."LOCATOR","SYS_P2"."PATHID")=1)
    8 - access("SYS_P2"."RID"=:B1 AND "SYS_P2"."PATHID"=HEXTORAW('5E6C') )
    Note
    - dynamic sampling used for this statement (level=2)
    - Unoptimized XML construct detected (enable XMLOptimizationCheck for more information)
    However, I also need to add an additional field to this index to allow appropriate queries against the data in the table, version number. This field can be seen from the statement above (VERSION) which runs OK and returns the data I’d expect. However, when I attempt to add this index using the following statement I get an error returned and the index becomes corrupted:
    alter index TEST_WQI_idx_1 rebuild
    parameters ('PATHS (INCLUDE ADD
    (/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version))');
    After some investigation, the issue seems to revolve around the use of the [1] condition in the statement /interopSection[1]. I can create the index by removing the [1] condition, but this does not return the expected result. In actual fact, as there are 2 interopSection elements in the xml file, both with a version number of 1, the statement returns 11, which would appear to be the two version numbers concatenated together. I need to be able to reference the version number from the first interopSection in the queries against the table, and I need to be able to index this column correctly for performance issues.
    I'm unsure why this xpath statement is not working correctly in the alter index statement, but returns ok when used within the query against the table and was wondering if you would be able to help me to have a working index against this element.
    Thanks in advance for any help you can provide in relation to this.

    Sorry, here is the error:
    Error starting at line 20 in command:
    alter index TEST_WQI_idx_1 rebuild
    parameters ('PATHS (INCLUDE ADD
    (/webPolicy/Sections/interopSection[1]/PolicyItems/item/Version))')
    Error report:
    SQL Error: ORA-29858: error occurred in the execution of ODCIINDEXALTER routine
    ORA-64131: XMLIndex Metadata: failure during the looking up of the dictionary
    ORA-30968: invalid XPATH or NAMESPACE option for XML Index
    29858. 00000 - "error occurred in the execution of ODCIINDEXALTER routine"
    *Cause:    Failed to successfully execute the ODCIIndexAlter routine.
    *Action:   Check to see if the routine has been coded correctly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for