Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the responsive-lightbox domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/wp-includes/functions.php on line 6114
DUAL Table in Oracle - Testingpool

DUAL Table in Oracle

Defining Dual Table :

  • DUAL is a Special table having one row and one column.
  • The Datatype of the Column is Varchar2(1) , Column Name is ‘DUMMY’ and Value is ‘X’.
  • It is created automatically by Oracle along with Data dictionary.
  • It is owned by SYS User , but accessible to all users.

Use of Dual Table in oracle:

Besides the data which is stored in the Database , SELECT Statement can also be used for the data which is not stored in the database e.g. to perform some calculation , fetch sysdate etc. Let’s understand this with an example as given below.

Example of performing some calculation:

Suppose, we want to perform an operation of adding two numbers i.e. 10 and 20 which does not exist in the database.Oracle do not have any placeholder to perform calculations internally, and there is no command in Oracle like  (SELECT 10 +20 ;). This is where DUAL Table is used to run such SQL statements that do not have any logical table name.Thus, Dual Table is used to get Data from such pseudo columns .

The above Query can then be written as SELECT 10 + 20 FROM DUAL;

Reason of Single Column in Dual Table:

 

Questions/Suggestions
Have any question or suggestion for us?Please feel free to post in Q&A Forum
Avatar photo

Shikha Katariya

Shikha

You may also like...

1 Response

  1. August 12, 2015

    […] Dual Table […]