Solved

meaning

Posted on 2015-01-14
4
82 Views
Last Modified: 2015-01-20
What is the meaning of this. What is happening here


insert into myobjects select * from myobjects;
0
Comment
Question by:jeevan mathew
4 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40549416
You are creating two of every row in myobjects.

In other words: duplicating the data.

You are inserting into one table the results of a select.  In this case, the same table.
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 40549421
that is effectively doubling your data.

"select * from myobjects" returns all rows and columns in the myobjects table.

"insert into myobjects" takes the result of the select statement and inserts all of those results into the table


note - if you have unique constraints or indexes on the table then it's likely the insert will fail because of duplicates on every row
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40549427
if you are suspicious that it will go for infinite loop, no it will not,
The SQL Processor will fetch all rows before insert and then it will insert those rows
if data is large temp tables are used
0
 

Author Closing Comment

by:jeevan mathew
ID: 40560887
Thank you.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now