Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create indexes in a right way?
Message
From
01/04/1998 10:32:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/04/1998 10:20:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088690
Message ID:
00088693
Views:
36
>Hello.
>
>I have a little problem with creating indexes. I don't really
>know what's right or not. Here is the problem:
>
>1. I have a table which has a field that is the PK.
> I insert a record and puts the value "1" in the PK-field.
>
>2. Then I mark the record for deletion.
>
>3. I insert another record and puts the value "1" in the PK-field.
> VFP will reject the added record because of key uniqueness
> violation.
>
>How can I solve this in a right way, so I don't miss out the rushmore
>optimization. I have tried the following but I'm not sure if this is
>the way to do it, and how can one use candidate indexes?
>
>INDEX ON pk_field TAG tab_pk PRIMARY FOR !DELETED()
>INDEX ON pk_field TAG field
>INDEX ON DELETED() TAG tab_del
>
>/Magnus Nordin
Magnus,
Instead of inserting values by hand to a PK field create a PKgenerator routine and set the default value of field to that value (ie:PKfielddefval=myPKgenerate(cTable,cType)). For an easier way you could try using sys(2015) as a default value for a PK field char(10).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform