Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

error messages during loading data

Hello,

How to manage and avoid error messages during loading data when the process doesn't  find a field?

I need that the data loading process take no notice of empty fields and continues uploading.

Thank u in advance.

4 Replies
Gysbert_Wassenaar

Set the ErrorMode to 0. Add this line to your script before the first load statement:

SET ErrorMode = 0;


The load will fail if a field doesn't exist, but the script will continue to execute. If you don't care which fields get loaded then use the start *:

LOAD * FROM somewhere;


talk is cheap, supply exceeds demand
Not applicable
Author

hI,

thank you Gysbert for your help but when I add SET ErrorMode = 0; the script doesn't give me error, it is true but it load anything.My objective is to load the fields that exist.

For exemple in the script I load "Nation", "capital" and "Address", and if the system doesn't find "Nation" in my file, I want to load capital and address.

There are a solution for this?

Not applicable
Author

hI,

thank you Gysbert for your help but when I add SET ErrorMode = 0; the script doesn't give me error, it is true but it load anything.My objective is to load the fields that exist.

For exemple in the script I load "Nation", "capital" and "Address", and if the system doesn't find "Nation" in my file, I want to load capital and address.

There are a solution for this?

Siva_Sankar
Master II
Master II

You can use the FieldNumber function to determine whether a field exists in a table. For example FieldNumber('MyField', 'MyTable') returns the position of MyField within MyTable.

If MyField does not exist in MyTable the function returns zero. You can adapt this to your advantage by loading all fields from your QVD into a temporary table and then checking to see if this table contains the field. If it does, you can continue loading. If not, you can simply set the field to zero.

Also, refer https://community.qlik.com/thread/77185