Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a copy of a table + 1 column
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Need a copy of a table + 1 column
Miscellaneous
Thread ID:
00807177
Message ID:
00807177
Views:
56
I am trying to create a copy of a table structure, but to add a column on the end with a constant value.

The following code seems to create the l_prop1.dbf table that is a copy of the property table structure with a column at the end named lettername. The 'into arr_prop' appears to create an array with the lettername value as the last element of the array. But when I 'append from', to the newly create table l_prop1, a date gets put into the lettername column. The previous two columns to lettername are both date types that should have values in them, but they are blank. Where does the following code go wrong. Will not a STRUCT return the column in the same order as a 'into array'.

cdatasource = rpath + '\DATA\L_prop1.DBF'
SELECT property
COPY STRUCTURE TO (cdatasource)
alter table (cdatasource) add column lettername c(50) not null
select *, (m.lettername) as 'lettername' from property where key = m.key into array arr_prop
select l_prop1
append from array arr_prop

Thanks

Brenda
Next
Reply
Map
View

Click here to load this message in the networking platform