Oracle in Java
Hai all,
In my program I am inserting a number of files at different times into a table in Oracle database as blob data. I retrieve the contents of the table later by using the select command. But the order of the files are changing at each retrieval. It is not changed to reverse order nor to a particular order. Each I time I retrieve the files and found that their order is changed !! Is it because some internal sorting is done inside the oracle database? Any help will be appreciated.
Thank you in advance,
Arya.
[545 byte] By [
Arya Dev] at [2007-11-11 7:26:35]

# 1 Re: Oracle in Java
My Oracle knowledge is very old (15 yrs) and rusty, but, if you don't include any
order by clause in your select statement, and the table has no primary key, then
the retrieved ordering is undetermined. It is not like; the db server gets the select statement and starts reading from some sequential disk location. It may well be that
the data you get is pulled out of a db cache (hash or something) and the ordering
you retrieve is pretty random.
Try including a new column in the blob table as a primary key or introduce a non-unique
index for a field (not the blob), and do and order by for that field.
sjalle at 2007-11-11 22:38:16 >
