Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Need an SQL*Plus script to show indexes on a given table

Re: Need an SQL*Plus script to show indexes on a given table

From: Dave Wotton <Dave.Wotton_at_it.camcnty.no-spam.gov.uk>
Date: 1998/02/03
Message-ID: <6b7kvo$74b@dns.camcnty.gov.uk>#1/1

home123_at_rocketmail.com (Tom) wrote:
>Could someone please post an SQL*Plus script that will list the
>indexes and the fields in those indexes for a given table? Thanks!

The following will do it ...

select index_name, column_name, column_position from all_ind_columns
where table_name like upper('&1'||'%')
order by 1,3,2
/

If you call it indexes.sql then (eg)..

@indexes rfw

gives ..

INDEX_NAME              COLUMN_NAME                    COLUMN_POSITION
----------------------- ------------------------------ ---------------
RFW_LINE_000            RFW_LINE_ID                                  1
RFW_LINE_003            PROPERTY_PARTY_ADDRESS_ID                    1
RFW_LINE_004            OFFICE_COPY_PRINTED                          1
RFW_LINE_005            CONTRACT_COPY_PRINTED                        1
RFW_LINE_006            REQUEST_FOR_WORK_ID                          1
RFW_LINE_006            PRINTED                                      2

HTH, Dave.

-- 

To reply by email, remove the "no-spam" bit from my email address.
Received on Tue Feb 03 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US