Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining Available Indexes for a VFP table, using SPT
Message
De
27/08/2002 08:00:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Determining Available Indexes for a VFP table, using SPT
Divers
Thread ID:
00693965
Message ID:
00693965
Vues:
51
Hi,

How can I determine all indexes and their corresponding index expressions for a VFP table that is being accessed via SPT?

As an example, below is how I implemented the logic to obtain indexes for SQL Server and Oracle tables.

TIA

Fernando
* Parameters

 gSQLHandle  = Handle of the ODBC connection
 cTableName  = Table to obtain indexes
 cTableOwner = Owner of table

* Expression for a SQL Server Table

 cSelectStr = "Exec sp_helpindex ?cTableName"

* Expression for an Oracle Table

 cSelectStr = "Select Table_Name     ,                              " + ;
              "       Table_Owner    ,                              " + ;
              "       Index_Name     ,                              " + ;
              "       Column_Position,                              " + ;
              "       Column_Name    ,                              " + ;
              "       Descend                                       " + ;
              "                                                     " + ;
              "From   All_Ind_Columns                               " + ;
              "                                                     " + ;
              "Where  Trim (Lower (Table_Name )) = ?cTableName  and " + ;
              "       Trim (Lower (Table_Owner)) = ?cTableOwner     " + ;
              "                                                     " + ;
              "Order  By Index_Name, Column_Position                "

* Executes the SQL Command

 SQLexec (gSQLHandle, cSelectStr, "CurIndexes") 

* Logic to Build String with Index Expressions

. . .
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform