LOAD DATA INFILE -> ignore missing file errors? - Advanced Installer Community
brrman
Posts: 11
Joined: Tue Jun 24, 2014 11:26 pm

LOAD DATA INFILE -> ignore missing file errors?

Hi

I have a SQL Script in my AI project that contains LOAD DATA INFILE commands on all the data files in our repository. However, certain customers will only need to have data updated based on their subscribed modules, so they will not receive certain data files in their download stream. The SQL Script will reference them and error out.

My issue is that I don't want to have a unique SQL Script for every customer, I need a way to use that same script for every customer and during runtime ignore the fact that some of the files do not exist. Validation occurs later with record counts so ignoring errors to contimue is OK this case.

Is there a way to do this? Ignore errors that occur during a SQL Script execution - specifically LOAD DATA INFILE errors of file not found?

I do know about the "Go to next statement in the script file" drop down selection on the SQL Script tab, but this option still presents an error message box before it continues. I would like to silently ignore the error.

thanks!
Bryan
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: LOAD DATA INFILE -> ignore missing file errors?

Hi Bryan,

You can try unchecking "Connection and all its scripts are verbose" option from the SQL connection settings, however this will suppress all error messages for that connection.To keep track, you can use "Log errors to file" option instead.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
brrman
Posts: 11
Joined: Tue Jun 24, 2014 11:26 pm

Re: LOAD DATA INFILE -> ignore missing file errors?

This works really well, Mihai. Thank you!

However this leads me to another question. Since all I will have at my disposal now in case of failure is a log file I would like to inject the installation log with my own specific remarks during the install.

I see in the documentation a way to do this via a custom external vbs file. But is there a way to do this via an inline vb script as a custom action in sequence? I do not want to trigger the logging via the interface. I tried taking the vbs code from the function and putting it into an inline script and it fails...


thanks!
Bryan
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: LOAD DATA INFILE -> ignore missing file errors?

Hi Bryan,

There's no problem, you should be fine adding the custom action from How to write a specific event in the log ? article with sequence. Just keep in mind that deferred custom actions do not have access to installer's public properties.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
brrman
Posts: 11
Joined: Tue Jun 24, 2014 11:26 pm

Re: LOAD DATA INFILE -> ignore missing file errors?

I did get the inline script to work.

thanks for your help, Mihai.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: LOAD DATA INFILE -> ignore missing file errors?

Good news Bryan, you're welcome.

Return to “Common Problems”