Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine Table Structures ? 2

Status
Not open for further replies.

Raccoon

Programmer
Aug 18, 1999
92
US
What is the best way to combine the fields from 3 tables into one new table? I want to keep them in a dbc as I don't want to lose my long field names, and I sure don't want to manually build the new tables. Fields of like names should be in new table just once.

Any ideas?
 
My response is "Why?". It's usually better to have related data in separate tables to prevent bloat of tables that have fields which may not be filled in for every record.
That said, you could create the new table, then open the other tables and set a relation, then SCAN...ENDSCAN through them, using the data to either append records to the new table, or a SCATTER / INSERT INTO construct.
Dave S.
 
What you say sounds good, but.... I want to take the resultant table, load it with a subset of the original tables, and use it to drive a list. I can't get a list to use related tables.
 
HI Raccoon,

I suggest create a view connecting all three tables and save it in yout DBC. There is no table size overhead, since the views are virtual. You can use the view designer/wizard.
After saving the view in your DBC, you can use it as if it is a TABLE... USE myView IN 0 ALIAS myView... is acceptable.
SO you get the benefit of both world.

I have also posted just a day back.. how to set the views name property etc.. by a simple utility. (Code provided by me in that).

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Ahhhh, knew I could count on the pros, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top