Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help to copy free table struct and then insert records
Message
From
06/04/2000 11:17:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00356247
Message ID:
00356295
Views:
13
>Want to create a small program to use for debugging client data problems. have about 15 free tables with a common customer number key. when the client has a problem with a specific customer, i want to pull off all the data for that customer number from the 15 tables into 15 test tables. i would then just manually copy the 15 tables onto my machine for testing with the debugger.
>
>using the STRUCT to make the table structure. what is the easiest way to copy the specific records from the original table into the test table? also, i have 15 peices of code, is there a way to make a generic peice of code where i just have data names for the original and test tables?
>
>is there any easier way of doing this?
>
>thanks
>
>brenda


Brenda,
There are many ways to do it and one is infamous SQL. You say there is a specific customer key. You could use it for a generic code :
lcKey = "SomeKey"
_GetTest("myTable")
_GetTest("myOther")
_GetTest("myTable1")
*....

function _GetTest
lparameters tcTableName
select * from (tcTableName) ;
  where myKey = lcKey ;
  into table ("Test_"+tcTableName)
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