I have a script that has been working as intended for months that started throwing an error as of today which is causing the reload to fail. I have no idea why and there is no documentation on the error type that was provided after debugging and using the error variables to get more clarity.
Can anyone provide insight on this issue?
Script below. Image of error attached.
Company &'/'&Warehouse&'/'&Product as %Inventory,
Date(Today()) as Date;
Select * from database.dbo.Product_Warehouse;
Store Product_WarehouseInventory into DATA\Product_WarehouseInventory.qvd(qvd);
Drop Table Product_WarehouseInventory;
/* get last date from QVD */
Let varMinDate = num(Peek('Date',-1,'ProductWarehouse_Inventory')) + 1;
Let varMaxDate = Num(Today());
/* get rates from last date to today */
FOR i = varMinDate to varMaxDate
LET varDate = text(Date(i,'YYYY-MM-DD'));
'$(i)' as Date,
STORE Product_Warehouse_Inventory into DATA\Product_Warehouse_Inventory.qvd (qvd);
It is not a good idea to use "load * from" - you cannot see what is behind this star. I recommend to replcae it everywhere in your script with the explicit list of fields. At least you'll be able to see why the load fails.
Thanks for your insight. I agree that * can be the source of unneccessary headache at times in hiding what it represents.
In this case, however, I know what the error is....but I don't know what that error means. Unless you are suggesting that by listing all the fields on load will produce a different error, do you have another insight that could help resolve this issue?