GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing docs.oracle.com — Comments
CommentsYou can associate comments with SQL statements and schema objects. Comments Within SQL StatementsComments can make your application easier for you to read and maintain. For example, you can include a comment in a statement that describes the purpose of the statement within your application. With the exception of hints, comments within SQL statements do not affect the statement execution. Please refer to "Hints " on using this particular form of comment. A comment can appear between any keywords, parameters, or punctuation marks in a statement. You can include a comment in a statement in two ways:
Some of the tools used to enter SQL have additional restrictions. For example, if you are using SQL*Plus, by default you cannot have a blank line inside a multiline comment. For more information, please refer to the documentation for the tool you use as an interface to the database. A SQL statement can contain multiple comments of both styles. The text of a comment can contain any printable characters in your database character set. Example These statements contain many comments: SELECT last_name, salary + NVL(commission_pct, 0),
job_id, e.department_id
/* Select all employees whose compensation is
greater than that of Pataballa.*/
FROM employees e, departments d
/*The DEPARTMENTS table is used to get the department name.*/
WHERE e.department_id = d.department_id
AND salary + NVL(commission_pct,0) > /* Subquery: */
(SELECT salary + NVL(commission_pct,0)
/* total compensation is salar + commission_pct */
FROM employees
WHERE last_name = 'Pataballa');
SELECT last_name, -- select the name
salary + NVL(commission_pct, 0),-- total compensation
job_id, -- job
e.department_id -- and department
FROM employees e, -- of all employees
departments d
WHERE e.department_id = d.department_id
AND salary + NVL(commission_pct, 0) > -- whose compensation
-- is greater than
(SELECT salary + NVL(commission_pct,0) -- the compensation
FROM employees
WHERE last_name = 'Pataballa') -- of Pataballa.
;
Comments on Schema ObjectsYou can associate a comment with a table, view, materialized view, or column using the HintsYou can use comments in a SQL statement to pass instructions, or hints, to the Oracle Database optimizer. The optimizer uses these hints as suggestions for choosing an execution plan for the statement. A statement block can have only one comment containing hints, and that comment must follow the {DELETE|INSERT|SELECT|UPDATE} /*+ hint [text] [hint[text]]... */
or {DELETE|INSERT|SELECT|UPDATE} --+ hint [text] [hint[text]]...
where:
Oracle Database treats misspelled hints as regular comments and does not return an error. Many hints can apply both to specific tables or indexes and more globally to tables within a view or to columns that are part of indexes. The syntactic elements tablespec::= ![]() Description of the illustration tablespec.gif indexspec::= ![]() Description of the illustration indexspec.gif Table 2-22 lists the hints by functional category and contains cross-references to its syntax. (In HTML and PDF, the cross-references are hyperlinks.) An alphabetical listing of the hints, including syntax, follows the table.
Table 2-22 Hints by Functional Category all_rows_hint::= ![]() Description of the illustration all_rows_hint.gif append_hint::= ![]() Description of the illustration append_hint.gif cache_hint::= ![]() Description of the illustration cache_hint.gif cluster_hint::= ![]() Description of the illustration cluster_hint.gif cursor_sharing_exact_hint::= ![]() Description of the illustration cursor_sharing_exact_hint.gif driving_site_hint::= ![]() Description of the illustration driving_site_hint.gif dynamic_sampling_hint::= ![]() Description of the illustration dynamic_sampling_hint.gif fact_hint::= ![]() Description of the illustration fact_hint.gif first_rows_hint::= ![]() Description of the illustration first_rows_hint.gif full_hint::= ![]() Description of the illustration full_hint.gif hash_hint::= ![]() Description of the illustration hash_hint.gif index_hint::= ![]() Description of the illustration index_hint.gif index_asc_hint::= ![]() Description of the illustration index_asc_hint.gif index_combine_hint::= ![]() Description of the illustration index_combine_hint.gif index_desc_hint::= ![]() Description of the illustration index_desc_hint.gif index_ffs_hint::= ![]() Description of the illustration index_ffs_hint.gif index_join_hint::= ![]() Description of the illustration index_join_hint.gif index_ss_hint::= ![]() Description of the illustration index_ss_hint.gif index_ss_asc_hint::= ![]() Description of the illustration index_ss_asc_hint.gif index_ss_desc_hint::= ![]() Description of the illustration index_ss_desc_hint.gif leading_hint::= ![]() Description of the illustration leading_hint.gif merge_hint::= ![]() Description of the illustration merge_hint.gif noappend_hint::= ![]() Description of the illustration noappend_hint.gif nocache_hint::= ![]() Description of the illustration nocache_hint.gif no_expand_hint::= ![]() Description of the illustration no_expand_hint.gif no_fact_hint::= ![]() Description of the illustration no_fact_hint.gif no_index_hint::= ![]() Description of the illustration no_index_hint.gif no_index_ffs_hint::= ![]() Description of the illustration no_index_ffs_hint.gif no_index_ss_hint::= ![]() Description of the illustration no_index_ss_hint.gif no_merge_hint::= ![]() Description of the illustration no_merge_hint.gif no_parallel_hint::= ![]() Description of the illustration no_parallel_hint.gif Restriction on NO_PARALLEL You cannot parallelize a query involving a nested table. no_parallel_index_hint::= ![]() Description of the illustration no_parallel_index_hint.gif no_push_pred_hint::= ![]() Description of the illustration no_push_pred_hint.gif no_push_subq_hint::= ![]() Description of the illustration no_push_subq_hint.gif no_rewrite_hint::= ![]() Description of the illustration no_rewrite_hint.gif no_query_transformation_hint::= ![]() Description of the illustration no_query_transformatn_hint.gif no_star_transformation_hint::= ![]() Description of the illustration no_star_transformation_hint.gif no_unnest_hint::= ![]() Description of the illustration no_unnest_hint.gif no_use_hash_hint::= ![]() Description of the illustration no_use_hash_hint.gif no_use_merge_hint::= ![]() Description of the illustration no_use_merge_hint.gif no_use_nl_hint::= ![]() Description of the illustration no_use_nl_hint.gif ordered_hint::= ![]() Description of the illustration ordered_hint.gif parallel_hint::= ![]() Description of the illustration parallel_hint.gif Oracle ignores parallel hints on a temporary table. Please refer to CREATE TABLE and Oracle Database Concepts for more information on parallel execution. parallel_index_hint::= ![]() Description of the illustration parallel_index_hint.gif pq_distribute_hint::= ![]() Description of the illustration pq_distribute_hint.gif
push_pred_hint::= ![]() Description of the illustration push_pred_hint.gif push_subq_hint::= ![]() Description of the illustration push_subq_hint.gif qb_name::= ![]() Description of the illustration qb_name_hint.gif rewrite_hint::= ![]() Description of the illustration rewrite_hint.gif rule_hint::= ![]() Description of the illustration rule_hint.gif spread_min_analysis_hint::= ![]() Description of the illustration spread_min_analysis_hint.gif star_transformation_hint::= ![]() Description of the illustration star_transformation_hint.gif unnest_hint::= ![]() Description of the illustration unnest_hint.gif use_concat_hint::= ![]() Description of the illustration use_concat_hint.gif use_hash_hint::= ![]() Description of the illustration use_hash_hint.gif use_merge_hint::= ![]() Description of the illustration use_merge_hint.gif use_nl_hint::= ![]() Description of the illustration use_nl_hint.gif use_nl_with_index_hint::= ![]() Description of the illustration use_nl_with_index_hint.gif
| |||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |