Solved

meaning

Posted on 2015-01-14
4
86 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 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 Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
create a nested synonym 4 41
error in my cursor 5 50
date show only hh:mm 2 40
Pivoting oracle table 9 74
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

726 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