>I have a fieldname as a variable - lcOldName, and the new field name is a variable as well. lcNewName.
>
>I can get the type of field, size etc from the old one...
>
>I tried the following, but couldn't get the syntax to work...
>i.e.
>add table (lcTableToFix) alter column (lcOldFldName) (lcNewName)
>
>I tried add the column and then moving the data from old to new and then dropping old column
>
>So if you have an example on how to do this, I guess its late and a long day nothing is clicking right now.
>
>Thanks all,
>Mike
Mike,
This is a quick test I just tried:
CREATE CURSOR test (charfield C(10))
ALTER table ('test') RENAME COLUMN ('charfield') TO ('NewField')
brow
So,
alter table (m.lcTableToFix) rename column (m.lcOldFldName) to (m.lcNewName)
If it's not broken, fix it until it is.
My Blog