That
is version specific, but you can use an index hint to do this in older
versions.
"Walking on water and developing software from a
specification are easy if both are frozen."
Christopher R. Spence <FONT
face="Comic Sans MS" size=2>Oracle DBA <FONT face="Comic Sans MS"
size=2>Fuelspot
<FONT face=Tahoma
size=2>-----Original Message-----From: Vijay_Krishna
[mailto:Vijay_Krishna_at_satyam.com]Sent: Tuesday, May 29, 2001 7:00
AMTo: Multiple recipients of list ORACLE-LSubject: RE:
Creating a sorted table
Hi <FONT face=Arial
color=#0000ff size=2>infact creating the table as sorted data from another
table works with oracle 8.1.6.3.0 as: <FONT face=Arial
color=#0000ff size=2> <FONT face=Arial color=#0000ff
size=2>create table agrs as
select * from agreements <FONT face=Arial color=#0000ff
size=2>order by agr_agreement_number desc;
Is this OK??
Vijay
- <FONT
face="MS Sans Serif" size=1>From: <FONT
face="MS Sans Serif" size=1>Connor McDonald[SMTP:hamcdc_at_yahoo.co.uk]
Reply To:
<FONT face="MS Sans Serif"
size=1>ORACLE-L_at_fatcity.com <FONT face="MS Sans Serif"
size=1>Sent: Monday, May
28, 2001 4:05 PM <FONT face="MS Sans Serif"
size=1>To: <FONT face="MS Sans Serif"
size=1>Multiple recipients of list ORACLE-L <FONT
face="MS Sans Serif" size=1>Subject:
Re:
Creating a sorted table
There is a very good reason for having
data "approximately" in physical order -
it can dramatically improve your buffer
hit rates.
IOT's are great for this, but if you're on an
earlier version then the occasional job
to "pseudo-cluster" the data can be a
very good thing...
Cheers <FONT face=Arial
size=2>Connor
- Diana_Duncan_at_ttpartners.com wrote: >
> Whyever would you want data inserted
in order? > There is no guarantee
that > Oracle will actually store the
records "in order", > there is no
performance > gain, and you can always
retrieve the records in > order by
using an order by > statement -- if
you really need ordered data, you >
could use a > index-organized table
with all of your columns, with > the
date as the first > column. But
methinks this would be dangerous for a <FONT face=Arial
size=2>> heavy transaction >
table. (Gurus, please correct me if I'm wrong here) <FONT
face=Arial size=2>> > However, if
you are still keen, you could do this <FONT face=Arial
size=2>> through a PL/SQL block, >
something like the following: >
> declare <FONT face=Arial
size=2>> cursor get_data is
<FONT face=Arial
size=2>>
select col1, col2, col3, ... <FONT face=Arial
size=2>> from
unordered_table <FONT face=Arial
size=2>>
order by whatever; > begin
> for dataRec
in get_data loop <FONT face=Arial
size=2>>
insert into ordered_table (col1, col2, <FONT face=Arial
size=2>> col3, ...) <FONT face=Arial
size=2>>
values (dataRec.col1, dataRec.col2, >
dataRec.col3, ...) <FONT face=Arial
size=2>> end loop; <FONT
face=Arial size=2>> end; > /
> >
Cheers! > <FONT face=Arial
size=2>> Diana > <FONT
face=Arial size=2>> >
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
"Browett,
Darren"
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<dbrowett_at_city.coquit
To: > Multiple
recipients of list ORACLE-L >
<ORACLE-L_at_fatcity.com>
<FONT face=Arial
size=2>>
lam.bc.ca>
cc: <FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
Sent
by:
Fax >
to:
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
root_at_fatcity.com
> Subject:
Creating a sorted
table
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
05/25/2001 06:45
PM
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
Please respond
to
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
ORACLE-L
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
<FONT face=Arial
size=2>>
> <FONT face=Arial
size=2>> > <FONT
face=Arial size=2>> > We have
un-ordered data in a table that needs to be <FONT face=Arial
size=2>> inserted into a >
transaction table in > order of the
date that the transaction took place. <FONT face=Arial
size=2>> > Oracle does not allow
"INSERT ..... AS SELECT ..... > ORDER
BY....." > or "CREATE TMP_TABLE
..... AS SELECT ..... ORDER >
BY......" > <FONT
face=Arial size=2>> Is there a method by which I can accomplish
this. > <FONT face=Arial
size=2>> Thank you in advance >
> Darren Browett <FONT
face=Arial size=2>> Sys Admin >
City of Coquitlam > --
> Please see the official ORACLE-L
FAQ: > <FONT face=Arial
color=#0000ff size=2><A target=_blank
href="http://www.orafaq.com">http://www.orafaq.com <FONT
face=Arial size=2>> -- > Author:
Browett, Darren > INET:
dbrowett_at_city.coquitlam.bc.ca >
> Fat City Network
Services -- (858) 538-5051 FAX: <FONT
face=Arial size=2>> (858) 538-5051 <FONT face=Arial
size=2>> San Diego, California
- Public Internet > access / Mailing
Lists > <FONT face=Arial
size=2>--------------------------------------------------------------------
> To REMOVE yourself from this mailing list,
send an > E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT
spelling of > 'ListGuru') and
in > the message BODY, include a line
containing: UNSUB > ORACLE-L
> (or the name of mailing list you want to be
removed > from). You may
> also send the HELP command for other
information > (like
subscribing). > <FONT
face=Arial size=2>> >
> <FONT face=Arial
size=2>> -- > Please see the
official ORACLE-L FAQ: >
<A target=_blank
href="http://www.orafaq.com">http://www.orafaq.com <FONT
face=Arial size=2>> -- > Author:
> INET:
Diana_Duncan_at_ttpartners.com >
> Fat City Network
Services -- (858) 538-5051 FAX: <FONT
face=Arial size=2>> (858) 538-5051 <FONT face=Arial
size=2>> San Diego, California
- Public Internet > access / Mailing
Lists > <FONT face=Arial
size=2>--------------------------------------------------------------------
> To REMOVE yourself from this mailing list,
send an > E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT
spelling of > 'ListGuru') and
in > the message BODY, include a line
containing: UNSUB > ORACLE-L
> (or the name of mailing list you want to be
removed > from). You may
> also send the HELP command for other
information > (like
subscribing).
- Connor
McDonald <A
target=_blank
href="http://www.oracledba.co.uk">http://www.oracledba.co.uk<FONT
face=Arial size=2> (mirrored at <FONT face=Arial color=#0000ff
size=2><A target=_blank
href="http://www.oradba.freeserve.co.uk">http://www.oradba.freeserve.co.uk<FONT
face=Arial size=2>)
"Some days you're the pigeon, some days you're
the statue"
<FONT face=Arial
size=2>____________________________________________________________
Do You Yahoo!? <FONT face=Arial
size=2>Get your free @yahoo.co.uk address at <FONT face=Arial
color=#0000ff size=2><A target=_blank
href="http://mail.yahoo.co.uk">http://mail.yahoo.co.uk
or your free @yahoo.ie address at
<A target=_blank
href="http://mail.yahoo.ie">http://mail.yahoo.ie <FONT
face=Arial size=2>-- Please see the
official ORACLE-L FAQ: <A
target=_blank
href="http://www.orafaq.com">http://www.orafaq.com <FONT
face=Arial size=2>-- Author:
=?iso-8859-1?q?Connor=20McDonald?=
INET: hamcdc_at_yahoo.co.uk
Fat City Network Services --
(858) 538-5051 FAX: (858) 538-5051 <FONT face=Arial
size=2>San Diego, California --
Public Internet access / Mailing Lists <FONT face=Arial
size=2>--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send
an E-Mail message to:
ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing:
UNSUB ORACLE-L (or the name of mailing
list you want to be removed from). You may <FONT face=Arial
size=2>also send the HELP command for other information (like
subscribing).
Received on Wed May 30 2001 - 10:19:13 CDT