GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  Scenarios
Go To First  |  Previous Question  |  Next Question 
 Scenarios  |  Question 4 of 25    Print  
Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why

  
Total Answers and Comments: 7 Last Update: August 24, 2009   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 15, 2005 10:28:29   #1  
Raja        

RE: Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select ...
select * from dual;output will be:DUMMYXIt has a field called DUMMY with a value X.When you run select sysdate from emp;You will not get any error. You will get system in all rows (as number of rows in emp table).
 
Is this answer useful? Yes | No
September 08, 2005 17:30:44   #2  
dimple        

RE: Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select ...
hi the sysdate is displayed irrespective of the table u r trying to select it from. The output is the same as that of using dual.
 
Is this answer useful? Yes | No
September 13, 2005 03:22:06   #3  
Ravi        

RE: Dual table explain. Is any data internally storing...
The output wont be same .Ideally dual has single row so when selecting sysydate you will get one row which is not the case in emp which has multiple row .
 
Is this answer useful? Yes | No
September 29, 2005 09:36:14   #4  
akebono        

RE: Dual table explain. Is any data internally storing...
The built-in function SYSDATE returns a DATE value containing the current date and time on your system. DUAL is built-in relation in Oracle which serves as a dummy relation to put in the FROM clause when nothing else is appropriate. For example try select 1+2 from dual; .So select sysdate from EMP won't generate the desired result.
 
Is this answer useful? Yes | No
November 25, 2005 05:11:53   #5  
santhi        

RE: Dual table explain. Is any data internally storing...
We won t get any error if we select sysdate from emp table.the system date will be displayed for each row of the emp table. but if will select sysdate from dual. asingle row in which system date will be displayed
 
Is this answer useful? Yes | No
July 19, 2006 15:59:00   #6  
P.Sathe        

RE: Dual table explain. Is any data internally storing...

You can issue sysdate from any table but the result will be as many rows as your table that you used.

The whole idea behind using DUAL table is to meet the the criteria as defined by RDBMS that you have to use Select.. from syntax to get the values from column.


 
Is this answer useful? Yes | No
August 24, 2009 08:03:08   #7  
rajesh_bu2001 Member Since: August 2009   Contribution: 2    

RE: Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why
Dual is a single row table in the system tablespace accessible to all the schema users. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row the constant is returned only once.
Now if we fire
sql> select sysdate from emp;

SYSDATE
----------
24/08/2009
24/08/2009
24/08/2009

It will show sysdate as many times as there are no of rows in the table. It wont throw any row. Thats why there is a dual table in Oracle for such kind of Selects.

Keep Smilin...
Rajesh



 
Is this answer useful? Yes | No


 
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