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, 2022 in Database by Vaani
• 7,070 points
2,052 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, 2022 by Neha
• 9,020 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, 2022 in Database by Vaani
• 7,070 points
859 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, 2022 in Database by Kithuzzz
• 38,020 points
539 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,370 points
12,525 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
1,277 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, 2022 in Database by Vaani
• 7,070 points
758 views
0 votes
0 answers

What is the definition of cardinality in SQL?

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

Feb 18, 2022 in Database by Neha
• 9,020 points
763 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, 2022 in Database by Kithuzzz
• 38,020 points
788 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, 2022 in Database by Kithuzzz
• 38,020 points
663 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, 2022 in Database by Neha
• 9,020 points
1,833 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, 2022 in Database by Neha
• 9,020 points
4,243 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP