Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Developer stripping inline hints

I'm using SQL Developer 3.1.07. I ran a query to Oracle with an inline hint --+ hint in it but SQL Developer seems to have stripped the hint before submitting it to the database. Multi-line hints /*+ hint */ didn't get stripped. Is there an option to keep inline hints/comments in SQL Developer?

like image 539
Alex Avatar asked Nov 04 '22 01:11

Alex


1 Answers

I think the solution to this problem is to always use the multi-line comment syntax, even for a single hint:

select /*+ ordered */
      ename 
from emp
where ....

I'm not sure there's any genuine advantage to the uni-line --+ syntax (although please tell if you do have a use case where only this would do). On the other hand it has one blinding disadvantage: it really mucks up queries stored in places which strip out carriage returns and line feeds, such as V$SQL.SQL_TEXT.

like image 193
APC Avatar answered Nov 15 '22 08:11

APC