Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us

The DUAL table in oracle

 Atikh Shaikh     oracle     No comments   

Everyone must have came across DUAL table present in oracle database, most of DBA's are using it daily but do not know what exactly it is, here we will discuss about the same
DUAL table is special one row one column table available by default in oracle database
oracle-dba-dual-table ,dual table in oracle

  • DUAL table is owned by SYS schema in oracle i.e. DUAL is part of oracle data dictionary
  • DUAL is having only one row and only a column named DUMMY of VARCHAR2 datafile with value x.
  • Selecting from dual table is useful for computing constant expressions with select statement, as DUAL is only one row table, the constant is returned only once.
  • The advantage to DUAL is the optimizer understand dual is special one row , one column table
  • There are times when some calculations need to be performed on values which are not available in database table, In such arithmetic calculations, table are not referenced only numeric values are used, To perform such calculations the SELECT query can be used to output the calculated values. A SELECT always requires a table in the FROM clause without which it fails.
  • Now we will perform some operations using DUAL table
Describing DUAL table
SQL> DESC DUAL
 Name         Null?    Type
 ---------- -------- --------------
 DUMMY                 VARCHAR2(1)

Selecting from DUAL table
SQL> select * from DUAL;

D
-
X

Performing arithmetic operations
SQL> select 25*25 from dual;

     25*25
----------
       625
select date using dual
SQL> select sysdate from dual;

SYSDATE
---------
17-JAN-19
Generating DDL statements using DUAL
SQL> select dbms_metadata.get_ddl('TABLE', 'DUAL') from dual;

DBMS_METADATA.GET_DDL('TABLE','DUAL')
------------------------------------------------------------------
   CREATE TABLE "SYS"."DUAL"
   (    "DUMMY" VARCHAR2(1)
   ) PCTFREE 10 PCTUSED 4

Features of DUAL is not limited to this operations only, we can much more than this
  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (74)

Blog Archive

  • ►  2018 (38)
    • ►  November (25)
    • ►  December (13)
  • ▼  2019 (33)
    • ▼  January (15)
      • Data Types in MongoDB
      • Oracle : RMAN Introduction
      • ORA-00265: instance recovery required, cannot set ...
      • Oracle : Starting with RMAN Commands
      • Oracle RMAN : Incremental Backups
      • MongoDB 4.0 New Features
      • Oracle RMAN : File Section for backup of large dat...
      • ORA-19804, ORA-19809: limit exceeded for recovery ...
      • Oracle RMAN: Fast Incremental Backups
      • The DUAL table in oracle
      • Oracle : Drop Pluggable Database (PDB) in 12c/19c/...
      • Oracle : The oerr Utility (Oracle Error)
      • Oracle RMAN : Incrementally Updated Backups
      • MySQL 8.0 New Features
      • Postgres spooling file and other command line options
    • ►  February (6)
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ►  2024 (5)
    • ►  January (2)
    • ►  March (3)
  • ►  2025 (6)
    • ►  March (1)
    • ►  April (3)
    • ►  May (2)

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • Oracle 23ai : Use of NOVALIDATE Constraints in IMPDP
    While performing impdp operations in the Oracle database, Oracle performs validation checks for every constraint on the imported table, that...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger