Skip to Content
avatar image
Former Member

SYBASE %_HINTS syntax in Open SQL for using Index

All,

We have recently migrated from Oracle to Sybase and I am trying to replace Oracle HINTS in our custom code with Sybase Hints with below syntax to force index.

%_HINTS SYBASE 'TABLE BKPF ABINDEX(BKPF~4)'. However it is not allowing keyword SYBASE next to %_HINTS but allows lot of other DB's.

Can somebody guide me how to use SYBASE Hints for forcing a particular index to be used. I have referred to Below OSS notes for syntax which seems doesnt work.

130480 - Database hints in Open SQL for Oracle

129385 - Database hints in Open SQL

1702338 - SYB: Database hints in Open SQL for SAP ASE

Sybase_Hint.PNG

Appreciate your help in this regard

Regards

Kasi

Sybase_Hint.PNG (8.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 16, 2016 at 07:47 AM

    If you're wanting the syntax of Sybase SQL for hints, I suggest your search/post in Sybase forums. When I do hints for Oracle, I read the Oracle reference, not the ABAP reference...

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 16, 2016 at 07:42 AM

    Hi,

    What does the syntax error say?

    The possible additions after %_HINTS are:

    AdditionDatabase SystemADABASSAP MaxDBAS400IBM System i (AS/400)DB2IBM DB2DB6IBM DB2 UDBHDBSAP HANA databaseMSSQLNTMicrosoft SQL ServerORACLEOracle DBSYBASESybase ASE

    -> There shouldn't be any problem. The following is syntactically correct in our systems:

    SELECT *

            FROM scarr

            %_HINTS SYBASE '...'

            INTO TABLE @DATA(itab).

    Horst

    PS: I don't  see your INTO-clause (?)

    Add comment
    10|10000 characters needed characters exceeded

    • Ooops,

      now I'm back in a 700 System, and indeed I get a syntax error for:

      DATA itab TYPE TABLE OF scarr.

      SELECT *

               FROM scarr

               INTO TABLE itab

               %_HINTS SYBASE '...'.

      But not for

      SELECT *

               FROM scarr

               INTO TABLE itab

               %_HINTS ORACLE '...'.


      -> The support for SYBASE is available since release 7.02. No syntax error there.


      Note 1702338 says:


      %_HINTS SYBASE syntax requires kernel 720 patch level 77 and will cause syntax errors with older kernel releases.



      Question: What is your basis release and what is your kernel release?