I have to use Java POI to batch import some excel files into Oracle database.
The Java program is very easy, just use JDBC to inert them.
But when I checked the table, I found the physical orders of data changed. For example, I import data like this:
S/N Name
S0001 Name1
S0002 Name2
S0003 Name3
S0004 Name4
S0005 Name5
S0006 Name6
.....
and the table is like that:
S/N Name
S0001 Name1
S0003 Name3
S0004 Name4
S0002 Name2
S0006 Name6
S0005 Name5
.....
Have anyone got the same strange issue before?
A heap organized table is inherently unordered. Unless your query specifies an ORDER BY clause, Oracle is free to return data in whatever order it chooses. And it is free to physically store data in any order regardless of the order of inserts.
If you care about the order in which data is returned, you can add an appropriate
ORDER BY,