Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Available Indexes for a VFP table, using SPT
Message
From
27/08/2002 08:00:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Determining Available Indexes for a VFP table, using SPT
Miscellaneous
Thread ID:
00693965
Message ID:
00693965
Views:
52
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

. . .
Next
Reply
Map
View

Click here to load this message in the networking platform