Can we insert a record in dual?

Questions by ashish88   answers by ashish88

Showing Answers 1 - 21 of 21 Answers

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

  Was this answer useful?  Yes

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

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.

imtiazali

  • Jun 5th, 2009
 

We cannot insert, update, delete record in dual table.
Dual means dummy. In the dual table only one column is present.

  Was this answer useful?  Yes

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

Niranjan Dubey

  • Jan 6th, 2012
 

Dual is a Dummy table when we execute query..

Code
  1. SELECT * FROM dual it will SHOW ..     DUMMY

  2.                                                    X            


It has Public synonym named DUAL thats why it is accessible from any session in any schema and there is only SELECT privilege is granted on dual thats why DML cannt be fire on DUAL table ...

by-
Niranjan Dubey

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions