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 (21)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (75)

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 (7)
    • ►  March (1)
    • ►  April (3)
    • ►  May (2)
    • ►  August (1)
  • ►  2026 (3)
    • ►  January (1)
    • ►  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 DBA Scripts
    Below are some Oracle scripts used in day to day activities note that below script will generate sql statements and then we need to run...
  • Error Code: 1419. You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
    You must have got mail from application team that they are facing below error while performing operations in database Error: Error Code: ...
  • Oracle AI Database 26ai: Redefining Operational Continuity
    Oracle’s latest release, AI Database 26ai , is built around one clear promise: making enterprise database operations faster, more resilient,...
  • Login to MySQL Database on Linux
    Below is method to login to mysql database on Linux server $ mysql -h <hostname> -u <username> -p <database name> ...

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