how to get the primary indexes of all the tables in a user using dbc tables

Database

how to get the primary indexes of all the tables in a user using dbc tables

how to get the primary indexes of all the tables in a user using dbc tables
3 REPLIES
Enthusiast

Re: how to get the primary indexes of all the tables in a user using dbc tables

Try this:
select *
from dbc.tables
where databasename = '';

If you query directly tablesx view, you'll get only the tables and views of the username you are logged in with.

Hope this helps,
Bye,
TDUser
Enthusiast

Re: how to get the primary indexes of all the tables in a user using dbc tables

Ooopsss, sorry, I was wrong in posting the sql; you are asking about PI and not only tables.... :-) !

Well, you may query dbc.indicesx view and look at indextype = 'p'.

Bye!
TDUser
Enthusiast

Re: how to get the primary indexes of all the tables in a user using dbc tables

You may want to use this SQL

SEL
*
FROM DBC.Indices
WHERE IndexType IN ('P', 'Q);

Where P - Accounts for NPPI
and Q for PPI tables

Vinay