GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 163 of 171    Print  
can we insert a record in dual?

  
Total Answers and Comments: 6 Last Update: October 28, 2009     Asked by: ashish88 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: tripathi.atul
 
Dual is a table owned by sys user and public synonym for the same is created.
So it is available to all the users of the database.

To get the details use following query :

select * from all_synonyms  a
where a.synonym_name = 'DUAL';

By using create table to create dual table we can insert into dual .

But without creating dual we cannot insert into dual.As we didn't have insert object privilege on sys.dual table or public synonym dual.

Above answer was rated as good by the following members:
subravin, shiiva, karams, universeproperty
June 20, 2008 01:36:58   #1  
ashish88 Member Since: June 2008   Contribution: 8    

RE: can we insert a record in dual?
yes i can insert a record in dual
to use this command
CREATE TABLE DUAL(COL1 VARCHAR(1));
select sysdate from dual
insert into dual values('X')
commit
insert into dual values('X')

to use and show the result


hope this Help You
Ashish Sharma

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
July 11, 2008 05:51:45   #2  
krishnaveni_g Member Since: July 2008   Contribution: 10    

RE: can we insert a record in dual?
Dual is a default table it contains one row one column. But we can create table like dual and insert records in that table

create table dual(name varchar2(20));
insert into dual values('Rushi');
commit;
Select * from dual;
It will show Rushi

select sysdate from dual;
This will show result from default dual table


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
August 15, 2008 14:16:40   #3  
spohilko Member Since: August 2008   Contribution: 1    

RE: can we insert a record in dual?
The answer depends on release. Before 10g it was possible starting with 10g - no.
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
September 09, 2008 04:38:47   #4  
tripathi.atul Member Since: September 2008   Contribution: 4    

RE: can we insert a record in dual?
Dual is a table owned by sys user and public synonym for the same is created.
So it is available to all the users of the database.

To get the details use following query :

select * from all_synonyms a
where a.synonym_name 'DUAL';

By using create table to create dual table we can insert into dual .

But without creating dual we cannot insert into dual.As we didn't have insert object privilege on sys.dual table or public synonym dual.

 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    
June 05, 2009 08:17:57   #5  
imtiazali Member Since: June 2009   Contribution: 11    

RE: can we insert a record in dual?
We cannot insert update delete record in dual table.
Dual means dummy. In the dual table only one column is present.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
October 28, 2009 02:05:56   #6  
Rabindra_Kumar Member Since: October 2009   Contribution: 6    

RE: can we insert a record in dual?

You can perform any DML operations in dual table provided that you have been given the privilege to do so.
However never try to perform any DML operations (delete/insert/update) in dual table because dual is basically used to work with scalar query. If you insert any record into dual table it may stop many running applications


 
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