473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

inserts and select

If I insert rows in a table with no index, is select guaranteed to return the rows in the order it was inserted.
Note: I am not doing any updates, deletes - pure inserts.
In my small test that I did, it always retrieves in the order I inserted. But not sure if there are any case where it can retrieve in a different order.
Jan 31 '07 #1
2 1325
michaelb
534 Expert 512MB
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
Feb 1 '07 #2
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
thanks for your reply. That's exactly what I want to find out under what circumstances will this happen ? If I am inserting let's say 1000 rows in one transaction, under what circumstances will the ROWIDs will not be in sync with the insert order ?
Feb 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: J Smith | last post by:
After doing some googling through the lists and such, I wasn't able to arrive at a solution for a problem I've run into recently. I've seen mention of similar symptoms, but my case seems different....
5
by: Florence HENRY | last post by:
Hello, well, almost everything is in the subject ! I have to fill 2 tables (more complicated than in the example !): CREATE TABLE A ( id serial primary key, foo text);
2
by: simonZ | last post by:
I create a transaction: sqlTran=sqlConn.BeginTransaction(IsolationLevel.Serializable); Then, I insert some data into report table with sqlCommand object: oCmd = new...
3
by: Rob | last post by:
Hi all, I have a bit of a complicated question, hope we have an SQL guru out there that can help us solve this killer problem. Due to the size of SQL Database we have (largest in the US), we...
0
by: dustwel | last post by:
I am currently trying to write a trigger that when an insert or update is made to a table, it inserts a copy of the row into a log table. It currently works when one row is inserted, but it will...
2
by: sangam56 | last post by:
Greetings. I suppose people out there can help in my problem. I am using sql server of microsoft visual studio 2005 itself. I have created a stored procedure which is give below. It works fine but...
18
by: Charles Law | last post by:
I have a sproc that returns data from a table using a simple SELECT. There are quite a few rows returned, e.g. ~150,000. In my first application, I use a reader on the sproc and iterate through...
9
by: lenygold via DBMonster.com | last post by:
I have the following trigger: --#SET TERMINATOR ! CREATE TRIGGER CROSS_REFF_TRIG AFTER INSERT ON NEW_CATALOG REFERENCING NEW AS nnn FOR EACH ROW MODE DB2SQL BEGIN ATOMIC DECLARE reason...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.