Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm just testing a simple Resident load of a table called 'Sales01', then I want to load it into a table called 'Sales'.
After it has been loaded into 'Sales', I'd like to drop 'Sales01', but it seems to be dropping both tables in this case.
I've attached the sample qvw.
Any ideas as to why this isn't working?
Many thanks!!
Hi,
When two tables anywhere in the script share the same number of fields and all fields are named alike, the second one is concatenated implicitly to the previous one, resulting in one bigger table. And that's exactly what it's happening to you. So when you DROP the first table you are dropping actually both LOADs, because they are concatenated. Just using NOCONCATENATE keyword in the second LOAD will avoid this.
Sales01:
LOAD * INLINE [
ID, USDSales, USDMargin, USDCost
A, 100, 1, 10
B, 500, 2, 20
C, 300, 3, 90
D, 200, 4, 30
E, 400, 5, 60
];
Sales:
NOCONCATENATE LOAD ID, USDSales, USDMargin, USDCost
RESIDENT Sales01;
DROP TABLE Sales01;
Hope that helps.
BI Consultant
EDIT: For your perusal, this is documented in the Reference Manual Book I, Section 23.7 "Automatic Concatenation"
Hi,
When two tables anywhere in the script share the same number of fields and all fields are named alike, the second one is concatenated implicitly to the previous one, resulting in one bigger table. And that's exactly what it's happening to you. So when you DROP the first table you are dropping actually both LOADs, because they are concatenated. Just using NOCONCATENATE keyword in the second LOAD will avoid this.
Sales01:
LOAD * INLINE [
ID, USDSales, USDMargin, USDCost
A, 100, 1, 10
B, 500, 2, 20
C, 300, 3, 90
D, 200, 4, 30
E, 400, 5, 60
];
Sales:
NOCONCATENATE LOAD ID, USDSales, USDMargin, USDCost
RESIDENT Sales01;
DROP TABLE Sales01;
Hope that helps.
BI Consultant
EDIT: For your perusal, this is documented in the Reference Manual Book I, Section 23.7 "Automatic Concatenation"
Thanks!