Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to exit while script fails?

Hi All,

how to exit while script fails?

Ex: I have application when i am loading data into the script getting error and loading  loaded data which is error data not loaded.

But my question is When i am loading loading if i get error loading data i need exit or trace the error for that need code.

Help me plz.

Ramya.

2 Replies
petter
Partner - Champion III
Partner - Champion III

You should set the Error Variable ErrorMode to 0 and then test the ScriptError variable for which return code was raised from the load statement.

Example:

set ErrorMode=0;

load * from abc.qvw;

if ScriptError=8 then

  exit script;

  //no file;

end if

petter
Partner - Champion III
Partner - Champion III

ScriptError

Returns the error code of the last executed script statement. This variable will be reset to 0 after each successfully executed script statement. If an error occurs it will be set to an internal QlikView error code. Error codes are dual values with a numeric and a text component. The following error codes exist:

   

0No error
1General error
2Syntax error
3General ODBC error
4General OLE DB error
5General custom database error
6General XML error
7General HTML error
8File not found
9Database not found
10Table not found
11Field not found
12File has wrong format
13BIFF error
14BIFF error encrypted
15BIFF error unsupported version
16Semantic error