cancel
Showing results for 
Search instead for 
Did you mean: 

SYBASE %_HINTS syntax in Open SQL for using Index

kasithunuguntla
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

matt
Active Contributor
0 Kudos

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...

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Well, he claimed, that the addition SYBASE doesn't work. That is ABAP syntax.

Even giving incorrect hints should not result in ABAP syntax errors (at least in the current releases).

kasithunuguntla
Participant
0 Kudos

Sorry, I should have provided more details.

There is no syntax error but the moment I type SYBASE after %_HINTS, it turns into RED but not for ORACLE or DB2 or other Data Base references.

We are on Basis 731 and Kernel Release 721

DB Client: Sybase ASE 16.0.02.03

DBSL Version: 721.02

Thanks in advance for your support.

Regards

Kasi

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you don't have a syntax error (kernel 720 patch level 77 or higher), just go on.

That SYBASE is colored red simply means that the syntax coloring is outdated and that you need a newer SAP GUI.

Horst

kasithunuguntla
Participant
0 Kudos

Horst,

Thanks so much. Will test in our QA system and update this post with the result.

Regards

Kasi

matt
Active Contributor
0 Kudos

I understood he was having problems with correctly crafting a Sybase hint.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

What does the syntax error say?

The possible additions after %_HINTS are:

AdditionDatabase System
ADABASSAP MaxDB
AS400IBM System i (AS/400)
DB2IBM DB2
DB6IBM DB2 UDB
HDBSAP HANA database
MSSQLNTMicrosoft SQL Server
ORACLEOracle DB
SYBASESybase 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 (?)

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

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?