Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi QV experts!
I am trying to do something in the load script but it seems that i am missing something.. hope that you can help me out. I will give you a simplified version of my problem.
I have a field A and a field B in the same table.
I want to delete the field A and rename the field B as A.
What i do is:
Drop A;
Rename B to A;
This doesn't give error but, below, the code uses the field A for some calculations (I want this field A to have the values of the field B, this is why i do the name change). And at this point the error comes out. Field Not Found - <A>
How could i solve it!?
Thanks!!
Thanks to everyone for the help and the interest. I dont really understand why, as the script is huge and messy (someone made it a long time ago and no one at my company fully understands it). Nevertheless i came p with something that worked out:
-I created a new table with the sa<ame fields as the old one, i deleted the old one, did the change in the new one and then rename it as the old one. Here it is:
#TABLE:
Load *
Resident TABLE;
Drop table TABLE;
Drop field A from #TABLE;
Rename Field B To A;
Rename Table #TABLE To TABLE;
Thanks for the help!
Why don't you do this?
LOAD A,
A AS B
FROM yoursourceTable;
Drop A;
Hi,
Try
Load
B as A
from -----------------------;
Could you post the actual script or a part of the document log that shows the code you are using?
-Rob
When you try to rename B into A, fields A and B are only present in this single table? And there isn't already a field called B in that table?
It seems to work for me:
RawData:
LOAD ID, A, A*2 AS B INLINE [
ID, A
1, 5
2, 7
3, 11
4, 2
5, 20
];
DROP Field A;
RENAME Field B TO A;
ProcessedData:
NOCONCATENATE
LOAD ID, A / 100.0 AS Percentage
RESIDENT RawData;
Thanks to everyone for the help and the interest. I dont really understand why, as the script is huge and messy (someone made it a long time ago and no one at my company fully understands it). Nevertheless i came p with something that worked out:
-I created a new table with the sa<ame fields as the old one, i deleted the old one, did the change in the new one and then rename it as the old one. Here it is:
#TABLE:
Load *
Resident TABLE;
Drop table TABLE;
Drop field A from #TABLE;
Rename Field B To A;
Rename Table #TABLE To TABLE;
Thanks for the help!