Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

General Script Error storing a QVD

Hi,

I have a lot of problems with general script errors because all my QVW's that run through the server publish their vital stats to a central LogFile.QVD at the end of their run which I then report on separately.

I think the problem is that the QVD logFile becomes locked when two or more try QVW's try and perform the Store at the same time. I have tried the sleep command as another post suggests for this error but this didn't resolve the issue. And the same post also says to delete the QVD which I don't think I can do via the script and even if I could I don't think this is the issue.

I think what I'm looking for is some sort of 'On Error' code which can be switched on just before, if an error is detected (general script error) then it will SLEEP and try again. It will continue to try this for a set number of goes and then Exit Script is it still doesn't have joy.....

I've looked at the manual but if anyone can give me some pointers that would be great.

Thanks

Rich

1 Solution

Accepted Solutions

Re: General Script Error storing a QVD

Hi Rich,

There is indeed a variable ScriptError (further documentation on its codes in the Reference Manual) that you can use in an If conditional in your script:

// Ignore errors and keep executing the next line

SET ErrorMode = 0;

[...] // Script here

STORE Table INTO File.qvd (qvd); // First attempt

// If everthing went fine, the following will only iterate 5 taking very few time

FOR vAttemptNo = 1 TO 5 // Number of attempts

     IF ScriptError = 1 THEN

          SLEEP 10000; // 10 secs

          EXIT SCRIPT WHEN $(vAttemptNo) => 5;

          STORE Table INTO File.qvd (qvd); // another attempt

     ENDIF

NEXT

I haven't tested the code, so I have missed something.

Hope that helps.

Miguel

4 Replies

Re: General Script Error storing a QVD

Hi Rich,

There is indeed a variable ScriptError (further documentation on its codes in the Reference Manual) that you can use in an If conditional in your script:

// Ignore errors and keep executing the next line

SET ErrorMode = 0;

[...] // Script here

STORE Table INTO File.qvd (qvd); // First attempt

// If everthing went fine, the following will only iterate 5 taking very few time

FOR vAttemptNo = 1 TO 5 // Number of attempts

     IF ScriptError = 1 THEN

          SLEEP 10000; // 10 secs

          EXIT SCRIPT WHEN $(vAttemptNo) => 5;

          STORE Table INTO File.qvd (qvd); // another attempt

     ENDIF

NEXT

I haven't tested the code, so I have missed something.

Hope that helps.

Miguel

Luminary
Luminary

General Script Error storing a QVD

Hi,

Why not have a separate stats QVD for each QVW?

Easy to concatenate them into a central file for analysis.

Regards,


Stephen

Not applicable

General Script Error storing a QVD

Thanks, I've followed the code and can understand your logic. I'll start to implement this across my qvw's and then, I guess, keep my figures crossed.

Cheers

Rich

Not applicable

General Script Error storing a QVD

Hi Stephen, originally that's how it worked and your right with the * wildcard when loading they'll concat simply..... think I'm a bit OCD really and prefer to remedy the problem and keep a single logfile rather than going back to loads (and I have a lot of QVWs and growing). Cheers for the repsonse though. Rich