I would like to know what is the definition of the reserved keyword 'THE' in Oracle SQL ?
The only thing I know is it's a function. It's a possible synonym of TABLE function (but I'm not sure).
The only trace I've found is here : http://docs.oracle.com/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm
Thanks
Oracle Reserved Words and Keywords Oracle reserved words have a special meaning to Oracle and so cannot be redefined. For this reason, you cannot use them to name database objects such as columns, tables, or indexes. Keywords also have a special meaning to Oracle but are not reserved words and so can be redefined.
TYPE is used for user-defined types within PLSQL packages.
The top three keywords employers use in Oracle Database Administrator job descriptions are Database Administration appearing in 20.02% of postings, Database 16.56%, and Oracle Database appearing in 14.46%.
The term LEVEL refers to a Pseudocolumn in Oracle which is used in a hierarchical query to identify the hierarchy level (parent->child) in numeric format. The LEVEL returns 1 for root row, 2 for child of root row and so on, as tree like structure. LEVEL must be used with CONNECT BY Clause.
The operand of THE is a subquery that returns a single column value for you to manipulate. The column value must be a nested table. Otherwise, you get a runtime error. Because the value is a nested table, not a scalar value, Oracle must be informed, which is what operator THE does.
Example
DECLARE
adjustment INTEGER DEFAULT 1;
...
BEGIN
...
UPDATE
THE(SELECT courses FROM department
WHERE name = 'Psychology')
SET credits = credits + adjustment
WHERE course_no IN (2200, 3540);
From Oracle Documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With