Skip to Content
author's profile photo Former Member
Former Member

secondery index related prob

hi all experts,

i have created a secondery index, but i don know how to use that index programaticcaly in where condition, plz help with a sample code.

thanx in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2009 at 12:11 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2009 at 12:13 PM

    Hi Dude..

    syntax

    SELECT * FROM SPFLI

    %_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'

    .......

    ENDSELECT.

    example code :

    
    Consider the following example: 
    REPORT Raghu_test.
    
    TABLES: spfli.
    
    DATA : t_spfli LIKE spfli OCCURS 0 WITH HEADER LINE.
    
    SELECT * FROM spfli
      INTO TABLE t_spfli
      %_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.
    
    LOOP AT t_spfli.
      WRITE :/ t_spfli.
    ENDLOOP.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2009 at 12:19 PM

    Just give criteria matching your index and the [SQL Optimizer|http://help.sap.com/erp2005_ehp_04/helpdata/EN/2d/0ef63ebdee3a4c958f51cfee32ad3a/frameset.htm] will use your index.

    You may also use [%_HINTS|https://service.sap.com/sap/support/notes/140825] to force SQL to use your index. (look at OOS [Note 129385 - Database hints in Open SQL|https://service.sap.com/sap/support/notes/129385] to get information for your database.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.