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
• 7,020 points
111 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
• 8,920 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
• 7,020 points
144 views
0 votes
0 answers

What is the Oracle equivalent of SQL Server's IsNull() function?

In SQL Server we can type IsNull() ...READ MORE

Sep 4 in Database by Kithuzzz
• 11,040 points
11 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,380 points
7,544 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
643 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
• 7,020 points
84 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
• 8,920 points
195 views
0 votes
0 answers

What is the difference between drop table and delete table in SQL Server?

What is the distinction between the following ...READ MORE

Aug 9 in Database by Kithuzzz
• 11,040 points
55 views
0 votes
0 answers

What is the purpose of Order By 1 in SQL select statement?

I discovered numerous views with an order ...READ MORE

Aug 19 in Database by Kithuzzz
• 11,040 points
20 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
• 8,920 points
374 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
• 8,920 points
138 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