0
I have an index on Oracle in which one of the columns is DESC
. I create it as follows:
CREATE INDEX XFT25TB ON FT25T (FT07CODEMP, FI16MODELO, FT07CODIGO, FT25ORDIMP, DESC)
However, when using Oracle’s data dictionary views, the index references a virtual column instead of referencing the column FT25ORDIMP
, as below:
SELECT * FROM USER_IND_COLUMNS WHERE TABLE_NAME = 'FT25T' AND INDEX_NAME = 'XFT25TB';
INDEX_NAME TABLE_NAME COLUMN_NAME COLUMN_POSITION COLUMN_LENGTH CHAR_LENGTH DESCEND
------------------------------ ------------------------------ -------------------------------------------------------------------------------- --------------- ------------- ----------- -------
XFT25TB FT25T FT07CODEMP 1 22 0 ASC
XFT25TB FT25T FI16MODELO 2 2 2 ASC
XFT25TB FT25T FT07CODIGO 3 22 0 ASC
XFT25TB FT25T SYS_NC00006$ 4 34 0 DESC
I wonder if there is any way to get the column name FT25ORDIMP
from the virtual column SYS_NC00006$
. I found no way to make that reference directly.
https://decipherinfosys.wordpress.com/2009/02/12/check-for-column-expression-of-function-based-index-in-the-schema/ without access to Oracle for testing however
– Motta
I didn’t know virtual could be indexed !
– Motta
@Motta, in the case what is indexed is a physical column even, the Oracle itself that creates the virtual column and inserts in the index...
– José Nelson Cultri
Another issue is also that I can see through the view
USER_IND_EXPRESSIONS
, the physical column of that item in the fieldCOLUMN_EXPRESSION
, but I can’t use this result in any WHERE, get as a string or anything, just view...– José Nelson Cultri