Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a list of fields that I want to get dropped from the tables that get loaded in a loop.
FOR each tablename in $(varTableNames)
LOAD * ; select * from $(tablename);
DROP Fields $(varFieldNames);
NEXT;
The varFieldNames is a comma separated list of some random fields in the form of 'Table1.field1','Table2.field5' etc.. Now e.g. if the tablename is not the Table1 I get a pop-up with the error message "wrong field name in the drop fields statement" or something for the Table1.field1. It breaks the script execution.
Is there a way to suppress that behavior? I just want to ignore the those errors and let the script run through.
put Set ErrorMode=0; before the loop. That should suppress the errors.
put Set ErrorMode=0; before the loop. That should suppress the errors.
Check out
in the help file to supress the errors
Thanks for the answers they both were helpful. What I had to do on top is just to up the "drop field" statement into a loop. Because otherwise the "drop fields" would not drop any field if at least one could not be found.