Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Email notification on reload error

Hi, I have just read a post where Gordon Savage has answered the question of setting up email notification for reload errors. I tried his response, set up the Mail on User Preferences and added an alert through the tools menu but I'm unable to get an error with this sample code:



SET

SET

ErrorMode = '1' ; ErrorMode = '0';

SQL

SELECT Colors, "Color_ID" FROM SMDSA.dbo."tbl_Colors";

For my Alert, I set it up as above

I'm probably doing something stupid wrong but please could someone help me.

Thanks in advance,

Shane



6 Replies
Not applicable
Author

Sorry, I see the script didn't paste properly. It is:

Set ErrorMode = '0' ;

SQL SELECT Colors, Color_ID FROM SMDSA.dbo.tbl_Colors

Set ErrorMode ='1' ;

thanks

Not applicable
Author

The alert is set for batch reloads only - are you reloading it interactively?

It shouldnt make any difference but set ErrorMode as a numeric value rather than as a string literal ie

SET ErrorMode=0; // ignore any script errors

(load statements for which to trap errors but continue processing here)

SET ErrorMode=1; // reset to default (halt and prompt)

Regards,

Gordon

PS! Hope I dont get your errors - forgot to hide my email address in the original post!

Not applicable
Author

Hi Gordon,

thanks for the response.

I just want to test the functionality of the Error Alert but loading something simple in the script and intentionally creating a reload error which will then send the email.

Would that be done in a different way?

Not applicable
Author

I use it for when an expected file is missing, so you could use something like:

SET ErrorMode=0; // ignore any script errors

LOAD *
FROM
[nonexistant.xls]
(biff, embedded labels, table is Sheet1$);

SET ErrorMode=1; // reset to default (halt and prompt)

to test how it works.

Regards,

Gordon

Not applicable
Author

Thanks Gordon,

I've got it working but I have a little issue that on a scheduled task, when the reload fails, Qlikview's Script Error window (Below) doesn't close. The Batch file used in the reload closes due to the Scheduled task setting of 'Stop the task if it runs for x' minutes' but the Script Error Window remains open.

How can I get it to close automatically?

Thanks for the help, I appreciate it.

Shane

Not applicable
Author

I'm not sure why that should be - I suspect its because the error comes from the ODBC driver rather than directly from the script as it works OK with a native 'LOAD' statement. Having said that, why is Qlikview reporting the error?

You may need to contact support for help.

Regards,

Gordon