Use ODBC API to retrieve indexes and keys on AS/400 - IBM AS400

This is a discussion on Use ODBC API to retrieve indexes and keys on AS/400 - IBM AS400 ; hi, i need to retrieve all indexes and keys from tables and files. right now i'm using SQLStatistics, but it retrieve only the indexes on tables (indexes that appear on the catalog sysindexes). i need to retrieve also the key ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Use ODBC API to retrieve indexes and keys on AS/400

  1. Use ODBC API to retrieve indexes and keys on AS/400

    hi,
    i need to retrieve all indexes and keys from tables and files.
    right now i'm using SQLStatistics, but it retrieve only the indexes on
    tables (indexes that appear on the catalog sysindexes).
    i need to retrieve also the key fields in physical file.

    1. how can i retrieve the key field in physical file through ODBC?
    2. Is there another AUTOMATIC way retrieving the key field? for example
    a way to AUTOMATICLY transofrm the key field into index (so that
    SQLStatistics will retrieve it)?


    Thanks,
    Dror


  2. Re: Use ODBC API to retrieve indexes and keys on AS/400

    If you're talking about a keyed physical file, you could try adding a primary
    key constraint that matches the key.

    The following utility shows how to retrieve info on keyed physical files:
    ibm.com/servers/eserver/iseries/db2/indexlist.htm

    D.R. wrote:
    > hi,
    > i need to retrieve all indexes and keys from tables and files.
    > right now i'm using SQLStatistics, but it retrieve only the indexes on
    > tables (indexes that appear on the catalog sysindexes).
    > i need to retrieve also the key fields in physical file.
    >
    > 1. how can i retrieve the key field in physical file through ODBC?
    > 2. Is there another AUTOMATIC way retrieving the key field? for example
    > a way to AUTOMATICLY transofrm the key field into index (so that
    > SQLStatistics will retrieve it)?
    >
    >
    > Thanks,
    > Dror
    >


    --
    Kent Milligan
    ISV Enablement - System i
    kmill@us.eye-bee-m.com (spam trick) GO HAWKEYES!!
    >>> ibm.com/iseries/db2

    (opinions stated are not necessarily those of my employer)

+ Reply to Thread