GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  Oracle
Go To First  |  Previous Question  |  Next Question 
 Oracle  |  Question 17 of 244    Print  
Can you explain what is DUAL table in oracle ?

  
Total Answers and Comments: 12 Last Update: February 25, 2009     Asked by: Sundra 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: lieni
 
Sorry dual is not a dummy table. Dual really exists and also that it has exactly one row and one column isn't correct.

You can insert:

Insert into dual value 'Y'

Select sysdate from dual will then return two lines with the actual timestamp.

Above answer was rated as good by the following members:
rajkumar_rsg
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
April 03, 2006 06:15:30   #1  
Smrati Saxena        

RE: Can you explain what is DUAL table in oracle ?

Hi

Dual is a virtual table ...it do not eists .

It is used to query fro pseudo columns..

eg;

select sysdate from dual


 
Is this answer useful? Yes | No
April 06, 2006 04:36:17   #2  
pramod kumar        

RE: Can you explain what is DUAL table in oracle ?

Dummy table with one row and one column we can select from it but cant insert update delete.


 
Is this answer useful? Yes | No
April 20, 2006 15:03:45   #3  
dhk        

RE: Can you explain what is DUAL table in oracle ?

Hello Friends

Dual is a dummy table which has one row and one column .


 
Is this answer useful? Yes | No
August 02, 2006 04:58:53   #4  
Renuka Rajput        

RE: Can you explain what is DUAL table in oracle ?
Dual is oracle created table.It is called as dummy table n it has one row and one cloumn.
 
Is this answer useful? Yes | No
July 30, 2007 09:38:54   #5  
lieni        

RE: Can you explain what is DUAL table in oracle ?
Sorry dual is not a dummy table. Dual really exists and also that it has exactly one row and one column isn't correct.

You can insert:

Insert into dual value 'Y'

Select sysdate from dual will then return two lines with the actual timestamp.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 18, 2007 06:31:11   #6  
shina        

RE: Can you explain what is DUAL table in oracle ?
Yes you are right that DUAL table has multiple cols but only one row.
But the insert statement that you've mentioned is not working.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
October 06, 2007 11:08:29   #7  
kishore        

RE: Can you explain what is DUAL table in oracle ?
Dual table is one which is having only one row & one coulmn and it is maintained by Oracle server. Which is used for mathamatical calculations like sqrt round power max min etc.
 
Is this answer useful? Yes | No
October 24, 2007 02:49:13   #8  
shravanam Member Since: August 2007   Contribution: 22    

RE: Can you explain what is DUAL table in oracle ?

DUAL IS A DUMMY TABLE. WE CAN INSERT UPDATE AND DELETE FROM DUAL TABLE IF YOU LOG IN WITH SYSTEM/MANGER PRIVILLAGES.

EXAMPLE:

SELECT * FROM DUAL;
no rows selected


DESC DUAL
Name Null? Type
----------------------------------------- -------- ----------------------------
DUMMY VARCHAR2(1)


SQL> INSERT INTO DUAL VALUES('Y');

1 row created.


SQL> SELECT * FROM DUAL;

D
-
Y


SQL> UPDATE DUAL SET DUMMY 'S';

1 row updated.

SQL> SELECT * FROM DUAL;

D
-
S


SQL> DELETE FROM DUAL;

1 row deleted.

SQL> SELECT * FROM DUAL;

no rows selected


EVEN IF U INSERT A ROW INTO DUAL TABLE STILL IT CAN BE USED TO RETRIEVE DATA FOR PSUEDO COLUMNS.

YOU CAN INSERT ONLY ONE RECORD INTO THE DUAL TABLE IF U TRY TO INSERT ANOTHER RECORD IT WILL NOT GIVE ANY ERROR IT WILL JUST DISPLAY 1 ROW INSERTED BUT U WILL FIND ONLY 1 ROW. ie THE PREVIOUS RECORD.


REGARDS
SHARAT


 
Is this answer useful? Yes | No
July 04, 2008 08:56:15   #9  
lanka_satya Member Since: January 2008   Contribution: 16    

RE: Can you explain what is DUAL table in oracle ?
most of our friends have given different answers for this..........infact most of them are same and correct .......but I will give one simple definition and small logic beyond its working.........?
I can say it is a practise table as it contains only one column and one row...that is its column name is dummy and value is x...even though if try to insert any value also it will take but will not be updated into the actual table.....

even we can create this type of table for ur own purpose......

second point which i have mentioned is:

we normally use this table for functions by using select stmt................
for example:
let us type this.

select sysdate from dual;
here the select statement works for every row in a table and its basic use is it will always try to retrive a value for the expression or column or function for which we have given in select statement and it works for each record..........

so normally it contains one row so you will be displayed with one value that's if u can see we cannot test group functions with dual table..

if you have any doubts regarding functionality of dual table:

let try to write this query...

select sysdate from emp

this will try to display sysdate for the number of rows that is present in emp table......

so dual table creation is different and don't try to think of inserting any rows in it because it won't take any as this is used for simple processing of select statement....




 
Is this answer useful? Yes | No
November 15, 2008 23:06:40   #10  
nare4u Member Since: April 2008   Contribution: 1    

RE: Can you explain what is DUAL table in oracle ?
SQL> select 2 from dual;

2
----------
2

SQL> select 2 3 from dual;

2 3
---------- ----------
2 3

 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape