Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating primary key from imported data
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00066546
Message ID:
00066559
Views:
34
>>I am importing data from a text file into a VFP 5.0a table. I need to create a primary key for this table. I tried creating a new field with a default value of SYS(2015) to create a unique value. But this doesn't work -- it fails after importing the first record.
>>
>>Any ideas?
>>
>>Jeff
>
>That's because SYS(2015) will check for unique procedure name and new record added will add nothing to the list of available procedures, right? So, change your mind and use proven approach of generating new consecutive integer ID using 'setup' table.

I'm just looking for a quick and easy way to add a primary key. I'm importing the data into a VFP table and then searching for duplicates based on three fields. I will then give the user a chance to delete the duplicates. After all the duplicates are removed the data is sent to a remote view on the SQL Server. After the data is on the SQL Server, my local VFP table is no longer needed.

Can you give me more information on what you mean by 'setup' table. Is this where I would have a separate table that contains one field (and one record?) that is updated each time a new record is added to my table? If so, how would I do this? Would I still use a default value in my import table?

Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform