Solved

meaning

Posted on 2015-01-14
4
88 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 77

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 74

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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.
Suggested Courses

617 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