Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to do this?
It would make sense to say:
Rename field
X
from
Y
To
Z
Unfortunately this from syntax does not seem to exist in this context.
Instead all fields are renamed, which causes problems if you want to rename only the field of one table.
I work with noconcatenated tables, so I work with independand data.
I solve this problem now by:
NOCONCATENATE LOAD
*,
X AS 'Z'
FROM
[STH];
DROP FIELD
X
FROM
Y;
Rename field X to Y;
Should Work ....
It does not work, if a different table already has a field Y.
The fieldname was Z btw.
Furthermore it renames fields in other tables that are also called X to Z.
That's correct,
1) you cannot rename a field to a field name which already exists.
2) renaming a field will rename the field globally
But what is it you try to achieve?
One thing you might do is to utilize the ALIAS function. If you load all your Alias' in the beginning of the script then it should rename the fields as you go along.
I solve this problem now by:
NOCONCATENATE LOAD
*,
X AS 'Z'
FROM
[STH];
DROP FIELD
X
FROM
Y;