Hi,
Thanks for your responses. I discussed this problem with my manager also and he told me that there is no big differance between Primary and Candidate indexes.
So, we decided to change Type from Primary to Candidate in our IndxDict table.
And now I do this: (Right now I'm checking its functionality)
SELECT IndxDict
SCAN FOR Upper(Table)=Upper(lcTableName)
lcCommand=;
"INDEX ON AllTrim("+IndxExpr+") TAG Alltrim(" +TagName+ ")"+;
IIF(Not Empty(Filter), " FOR Alltrim("+Filter+")","")+;
IIF(UPPER(Type)="CANDIDATE"," CANDIDATE","")
SELECT (lcTableName)
&lcCommand
SELECT IndxDict
ENDSCAN
>You can use ALTER TABLE to add a primary key.
>
>>Hi!
>>
>> Let's me describe my problem:
>> I have a DataDictionary.DBC which contains several tables, one of them is DataDict, which describes all fields in all my tables, another table is IndxDict, which describes indexes in all my tables. It has this structure:
>>Table - Character (name of table)
>>TagName - Character
>>IndexExpr - Memo
>>Type - Character (Primary, Regular, Candidate, etc.)
>>Filter - Memo.
>>
>> As you can guess, this DataDictionary uses to generate our life DataBase with all tables and Indexes.
>>
>> I wrote a code for table generating, but have some problems with Indexes.
>>
>> In help I read:
>>
>> INDEX ON eExpression TO IDXFileName | TAG TagName [OF CDXFileName]
>> [FOR lExpression]
>> [COMPACT]
>> [ASCENDING | DESCENDING]
>> [UNIQUE | CANDIDATE]
>> [ADDITIVE]
>>
>> I didn't see Primary or Regular here in this Syntax.
>>
>> Could you please help me with this? I mean, which command I need to use to create indexes using my IndxDict.
>>
>> Your help will be really appreciated.
If it's not broken, fix it until it is.
My Blog