Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying Tables plus adding fields.
Message
From
07/07/1999 11:53:38
 
 
To
07/07/1999 11:41:51
Brent Knight
Progressive Impressions International
Bloomington, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00238339
Message ID:
00238350
Views:
10
>Hello,
>
>I could use some help here. What I am trying to do is take the records from 6 different tables and put all the records into one table. To do this I am going to have to add a few fields so I know which table the record comes from.
>
>Here is the code that I am using.
>
>use newmen.dbf
>go top
>scan
> INSERT INTO counttbl(Num,priority,last,first,sex,act,;
> act_length,act_date,status,trans_num,;
> trans_type,comments1,comments2,add_date,;
> prog_code,trans_stud,new_stud,ret_stud,;
> late_ret_stud,off_stud,temp_stud)
> VALUES (num,priority,last,first,'m',act,act_length,act_date,;
> status,trans_num,trans_type,comments1,comments2,;
> add_date,prog_code,tran_stud,'1','0','0','0','0')
>endscan
>
>The values need to come from the newmen table and go into the counttbl. There is no sex, new_stud, ret_stud, late_ret_stud, off_stud, or temp_stud so I am just putting flags in them to make it easy to run queries on.
>
>Is this even a good way to do this???
>
>I would appreciate any help that could be given.
>
>Thanks
>
>Brent Knight
>Residential Computing

If you are having problems with pulling fields with different names than the ones on the destination table you can use 'as NewDestinationName'and the field will have that name, in this case you don't have to insert constants previous to the required values.

If you don't need the functionality mentioned above I would do it in that exact way.

Regards
Oscar
Previous
Reply
Map
View

Click here to load this message in the networking platform