To: Multiple recipients of list ORACLE-L
[EMAIL PROTECTED]
cc:
Subject:Re: Order rows
Jared,
Oracle gives you a chance to use it. And it's very common to use. Isn't
it?
There is no conception of phisical location in realational theory. I'm not
saying that pure theory
Jared,
Oracle gives you a chance to use it. And it's very common to use. Isn't it?
There is no conception of phisical location in realational theory. I'm not
saying that pure theory is the best for practical use, though. :)
BTW, Oracle stores ROWID in indexes... instead of primary key (which is
:
Subject:Re: Order rows
Jared,
Oracle gives you a chance to use it. And it's very common to use. Isn't
it?
There is no conception of phisical location in realational theory. I'm not
saying that pure theory is the best for practical use, though. :)
BTW, Oracle stores ROWID
Hi,
In regular way, there is no such method. Remember Codd's rules about
relational databases? :)
But you can create a before insert trigger, which fills a column with
current timestamp or sequencial value from sequence (better).
Later, use ORDER BY clause in SELECT statement.
Alexandre
-
Ther is no concept first row/ last row in any RDBMS. The concept of ROWID
fails as the rows are deleted and hence inserted again. The previous ROWID's
are reallocated again. The only way you can get the rows sorted out in the
way they have been entered is by creating a column in the table
Vikas:
If you want to FORCE the order you can do couple of things like having a big
PCTFREE (to make sure that no rows are migrated because of the updates) and
small PCTUSED so that the blocks are never reused.
In this case records will be stored in (close to) ordered manner and SELECTs
will
Yeah...
In fact ROWID is the Oracle implementation and against RDBMS rules. :)
ROWID gives information about phisical location of the record. That MUST NOT
be in PURE relational database. Nowadays, there is no pure relational
database implementation.
BTW, it's better to use sequencial value then
Use a sequence...
SQL create sequence mysequence;
SQL alter table abc add (sequence_no number);
SQL insert into abc(sequence_no, a) values (mysequence.nextval, 500);
...
SQL select a from abc order by sequence_no;
Using a date column will only give you accuracy down to a whole second.
Do you want to physically order them or do you just want to know by time the
order in which they were entered.
if the first, no, not that I know of. If the later, yes, add another column
(ins_date date) and a trigger to populate that column with sysdate when you
insert a row. You can then
Rachel:
If you want to FORCE the order you can do couple of things like having a big
PCTFREE (to make sure that no rows are migrated because of the updates) and
small PCTUSED so that the blocks are never reused. In this case you will get
the
rows in the inserted order.
ANother alternative is
K Gopalakrishnan,
This is bad advice. What happens after some records are deleted and new
ones inserted. The new records will be placed within the spaces made empty
by the deleted records.
I would never guarantee retrieving data in the order it was inserted unless
the table contained a
Carmichael) |
| Subject: RE: Order rows |
|
using a date will work unless you get multiple records created in a given
second. Use a sequence generated number. The larger the number, the newer
the record
|
|| |
|+---
|
||
| To: [EMAIL PROTECTED] |
| cc: (bcc: Rachel Carmichael) |
| Subject: Re: Order rows |
|
Rachel:
If you want to FORCE the order you can do couple of things
using a date will work unless you get multiple records created in a given
second. Use a sequence generated number. The larger the number, the newer
the record. Just order by the sequence to see the order the records were
inserted.
Caver
-Original Message-
[mailto:[EMAIL PROTECTED]]
Tom:
I am just giving an option NOT that I recommend everyone to use that.
Then coming to your question:
This is bad advice. What happens after some records are deleted and new
ones inserted. The new records will be placed within the spaces made
empty
by the deleted records.
Set the
Or ... if you are using 9i use the timestamp that gives you a resolution 9
digits after the decimal point for seconds, use that.
Raj
__
Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed
K Gopalakrishnan,
No matter how I look at this, it is still bad advice. Depending on Oracle
internals to return rows in the manner in which they are inserted, when
Oracle states in all of it's training classes that this is not possible, is
bad advice.
You might be correct in what you say - but
In fact ROWID is the Oracle implementation and against RDBMS rules. :)
ROWID gives information about phisical location of the record. That MUST
NOT
be in PURE relational database. Nowadays, there is no pure relational
database implementation.
That doesn't really count, as Oracle does not
18 matches
Mail list logo