Re: Order rows

2002-05-17 Thread Alexandre Gorbatchev
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

Re: Order rows

2002-05-16 Thread Alexandre Gorbatchev
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

Re: Order rows

2002-05-16 Thread Jared . Still
: 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

Re: Order rows

2002-05-15 Thread Alexandre Gorbatchev
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 -

RE: Order rows

2002-05-15 Thread Vikas Khanna
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

Re: Order rows

2002-05-15 Thread mail.yahoo.com
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

Re: Order rows

2002-05-15 Thread Alexandre Gorbatchev
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

RE: Order rows

2002-05-15 Thread Lord, David - CSG
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.

Re: Order rows

2002-05-15 Thread Rachel_Carmichael
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

Re: Order rows

2002-05-15 Thread K Gopalakrishnan
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

RE: Order rows

2002-05-15 Thread Mercadante, Thomas F
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

RE: Order rows

2002-05-15 Thread Rachel_Carmichael
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

Re: Order rows

2002-05-15 Thread Rachel_Carmichael
| || | |+--- | || | 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

RE: Order rows

2002-05-15 Thread Toepke, Kevin M
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]]

Re: Order rows

2002-05-15 Thread K Gopalakrishnan
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

RE: Order rows

2002-05-15 Thread Jamadagni, Rajendra
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

RE: Order rows

2002-05-15 Thread Mercadante, Thomas F
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

Re: Order rows

2002-05-15 Thread Jared . Still
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