What is the Oracle PL SQL -- rule

0 votes

I looked through the Oracle Optimizer Hints documentation but couldn't locate a specific reference for a —+rule. This rule appears to be an out-of-date remnant from a code generating tool that was intended to replace "—+rule" with user or produced /*+ SQL */ hint code.

What are your thoughts? Does the —+rule code in the above example [literally] do anything? or should I just throw it away?

Oracle 10g2 with the most recent supported upgrades, Delphi 6 with Direct Oracle Access components. The majority of the Legacy SQL code was written for Oracle 7 and 8.

My query:

SELECT --+rule
  userid,
  username
FROM
  users
ORDER BY
  userid
Feb 22 in Database by Vaani
• 5,040 points
9 views

1 answer to this question.

0 votes
The answer is in the material you provided as a reference:

Within a statement block, the following syntax demonstrates suggestions included in both forms of comments that Oracle allows.

{DELETE|INSERT|MERGE|SELECT|UPDATE} /*+ hint [text] [hint[text]]... */

or

{DELETE|INSERT|MERGE|SELECT|UPDATE} --+ hint [text] [hint[text]]...

The --+ hint format requires that the hint be on only one line.

So it was a syntactic rule for hints that was permitted, but I don't think I've ever seen it.

The "rule" hint in Oracle SQL refers to using the Rule Based Optimizer (RBO) rather than the CBO (Cost Based Optimizer), which has been deprecated since Oracle 10. As a result, you cannot dismiss Oracle: it should be considered, but without assistance.
answered Feb 23 by Neha
• 6,260 points

Related Questions In Database

0 votes
1 answer

What is the difference between SQL, PL-SQL and T-SQL?

SQL SQL is the standard language for relational ...READ MORE

answered Feb 16 in Database by Vaani
• 5,040 points
56 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,360 points
7,038 views
0 votes
1 answer

What is the rule to use group by, having and where clause?

Hi samar, this is a very common mistake ...READ MORE

answered Jul 2, 2019 in Database by anonymous
588 views
0 votes
1 answer

What is the difference between HAVING and WHERE in SQL?

HAVING: It is used to check after the aggregation ...READ MORE

answered Feb 17 in Database by Vaani
• 5,040 points
31 views
0 votes
0 answers

What is the definition of cardinality in SQL?

My book definition of Database Systems does ...READ MORE

Feb 18 in Database by Neha
• 6,260 points
64 views
0 votes
1 answer

What are the manipulation functions in SQL?

There are three case manipulation functions in ...READ MORE

answered Oct 11, 2018 in Database by DataKing99
• 8,240 points
3,137 views
0 votes
1 answer

What is subquery in SQL?

A subquery is a query inside another ...READ MORE

answered Oct 12, 2018 in Database by DataKing99
• 8,240 points
825 views
0 votes
1 answer

What is the need of MERGE statement?

This statement allows conditional update or insertion of ...READ MORE

answered Oct 23, 2018 in Database by DataKing99
• 8,240 points
224 views
0 votes
1 answer

What is the definition of cardinality in SQL?

Cardinality is defined as the "number of ...READ MORE

answered Feb 15 in Database by Neha
• 6,260 points
80 views
0 votes
1 answer

What is the candidate key in SQL Server?

A Candidate Key is any column or ...READ MORE

answered Feb 23 in Database by Neha
• 6,260 points
15 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP