Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rwunderlich
Partner Ambassador/MVP

Possible to use Oracle /*+*/ hint in SQL SELECT

I have a user attempting to use a hint with Oracle like:

SELECT /*+full(a)*/ col1, col2 blah blah...

She reports the hint is not reaching the Oracle server. I suspect QV is stripping out the hint because it looks like a /* */ QV comment. Anyone else experienced this problem? Any workarounds?

Thanks,
-Rob

1 Solution

Accepted Solutions
Not applicable

Set StripComments=0;

After your sql Please use Set StripComments=1;



If this variable is set to 0, stripping of /*..*/ and // comments in the script will be inhibited. Certain database drivers utilizing /*..*/ comments for defining hints in select statements may otherwise cause script errors. It is recommended that this variable be reset to 1 immediately after the statement(s) where it is needed. If this variable is not defined, stripping of comments will always be performed.



View solution in original post

2 Replies
Not applicable

Set StripComments=0;

After your sql Please use Set StripComments=1;



If this variable is set to 0, stripping of /*..*/ and // comments in the script will be inhibited. Certain database drivers utilizing /*..*/ comments for defining hints in select statements may otherwise cause script errors. It is recommended that this variable be reset to 1 immediately after the statement(s) where it is needed. If this variable is not defined, stripping of comments will always be performed.



mellerbeck
Creator II

Completely necroing this thread but....

https://boristyukin.com/qlikview-and-oracle-database-tips-for-performance/

 

Normally Oracle query hints will be written using /*+ ... */syntax. One day I spent many hours trying to figure out why one of my queries took forever to finish if I ran it from QlikView and took only a minute if I ran it from Oracle SQL Developer. Turned out that QlikView by default would strip out comments from SQL statement and treat /*+ ... */ as a comment.

This "feature" is discussed here.

Solution is easy - just use --+ syntax instead if you need to pass a query hint. Of course it is a very easy thing to forget!