Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dba_ind_columns - how to determine if column asc or desc

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
US
The system table dba_ind_columns doesn't specify whether an index column is ascending or descending. Is there any way to determine this using database queries?
 
DDiamond,

Since you posted this inquiry in the "Oracle 8i and earlier" forum, I presume you are looking for the "ASC"/"DESC" designation for one of those versions. I don't believe that such designator exists until later versions, but I can't test on a version 8i instance since it's been years since Oracle 8i was available to me. <grin>


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Unfortunately, I'm still using oracle 8.0, and it does support asc / desc indexes.
 
Hi,
The docs indicate that Oracle sees an index with ASC or DESC as Function-based - as such, there is probably no dictionary entry specifying the order (The function itself handles this, not a dictionary entry )
tahiti/tahiti.tabbed?section=73943 said:
ASC | DESC
Use ASC or DESC to indicate whether the index should be created in ascending or descending order. Indexes on character data are created in ascending or descending order of the character values in the database character set.

Oracle treats descending indexes as if they were function-based indexes. You do not need the QUERY REWRITE or GLOBAL QUERY REWRITE privileges to create them, as you do with other function-based indexes. However, as with other function-based indexes, Oracle does not use descending indexes until you first analyze the index and the table on which the index is defined. See the column_expression clause of this statement.

Restriction: You cannot specify either of these clauses for a domain index. You cannot specify DESC for a reverse index. Oracle ignores DESC if index is bitmapped or if the COMPATIBLE initialization parameter is set to a value less than 8.1.0.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I think Dave may have been right about oracle 8.0 not supporting desc indexes. I found an except from my oracle 8.0 manual:
ASC / DESC are allowed for DB2 syntax compatibility, although indexes are always created in ascending order.
I was fulled into thinking they existed because oracle 8 will except the desc key word in the syntax, but it will create an ascending index even if you use the desc key word.
 
Hi,
Yes, based on this part of the docs:
Restriction: You cannot specify either of these clauses for a domain index. You cannot specify DESC for a reverse index. Oracle ignores DESC if index is bitmapped or if the COMPATIBLE initialization parameter is set to a value less than 8.1.0.
, it looks like it was an 8.1 addition.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top