How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask flopcat98 Your Own Question
flopcat98, Consultant
Category: Software
Satisfied Customers: 9104
Experience:  Consultant 30 years in nyc computer industry working with PC and networks banks brokerage legal etc.
Type Your Software Question Here...
flopcat98 is online now
A new question is answered every 9 seconds

Our inventory system consists of about a dozen FoxPro

Customer Question

Our inventory system consists of about a dozen FoxPro tables. I need to create a master table structure that includes all the columns from all the tables with no duplicates and no omissions. Some columns appear in most of the tables and some in only one or two. When a column appears, it always has the same parameters - width, type, decimals. I realize I can start with one table structure and manually modify it to add the other columns, but that's tedious and I'm likely to make mistakes. I need an automated or semi-automated way to create this master table structure.
Submitted: 11 months ago.
Category: Software
Expert:  flopcat98 replied 11 months ago.

Hi, I'm Robert and I'll be helping you with your computer question.

Expert:  flopcat98 replied 11 months ago.

you can use the field() command to pull the name of each field and drop it into a new table

do this for each table and then sort by name and manually remove duplicates or use another query to remove the duplicates

the basic syntax is like this

you may have to tweak it some i havent actually ran it

select A

USE file1

select B

use newtable

select file1

FOR gnCount = 1 TO FCOUNT( ) && Loop for number of fields ?

temp = FIELD(gnCount)

select newtable

append blank

replace name with temp

select file1