Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
Does anyone know how to do this???
i have tried;
LET vScriptError = ScriptError;
This doesn't work! Any ideas?
Cheers
Hi guys
Thanks for all your help, but i've decided to go with this and it works well.
set ErrorMode=0;
load * from abc.qvw; //considering that abc.qvw doesn't exist
ErrorLog:
LOAD
'$(ScriptErrorCount)' as vScriptErrorCount,
'$(#ScriptError)' as vScriptErrorNo,
'$(ScriptError)' as vScriptError,
'$(ScriptErrorDetails)' as vScriptErrorDetails
AutoGenerate(1);
Hi,
This piece of code works:
set ErrorMode=0;
load * from abc.qvw; //considering that abc.qvw doesn't exist
let var = ScriptError;
Regards,
Erich
Hi Erich
That does work, but i am looking for the ScriptError number as well as the ScriptErrorDetails.
let var = ScriptError;
let var1 = ScriptErrorDetails;
var = 'File Not Found' not '8'
var1 = 'null' not 'Cannot open file...etc'
Any ideas??
Ok, I got what happened to ScriptError. Apparently, the data type is dual ( number and string).
You can get the 8 using this:
let var = num(ScriptError);
For scriptErrorDetails, maybe it will not return a description for this case, since the 'File not Found' might be enough.
According to QV Help, it will return details for errors 3 and 4.
Returns a more detailed error description for some of the error codes above. Most importantly this variable will contain the error message returned by ODBC and OLE DB drivers for error codes 3 and 4.
Hope it helps,
Erich
Hi Erich
Thanks for getting back. Yes the Num(ScriptError) worked well!!!
But i don't understand why you can only populate one variable.
If you run the following example var2 is populated, but if you then uncomment var1 then var2 does not update. It's as though the ScriptError variables are reset immediately after the next step??!?!
Can you think of a way of capturing all three variables?
set ErrorMode=0;
load * from abc.qvw; //considering that abc.qvw doesn't exist
//let var1 = ScriptError;
let var2 = ScriptErrorDetails;
//let var3 = num(ScriptError);
Script Error is reset if the next executed statement is executed succesfully
You can use the list error details from the ScriptErrorList.
Help File:
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.
Hi guys
Thanks for all your help, but i've decided to go with this and it works well.
set ErrorMode=0;
load * from abc.qvw; //considering that abc.qvw doesn't exist
ErrorLog:
LOAD
'$(ScriptErrorCount)' as vScriptErrorCount,
'$(#ScriptError)' as vScriptErrorNo,
'$(ScriptError)' as vScriptError,
'$(ScriptErrorDetails)' as vScriptErrorDetails
AutoGenerate(1);
Thats it. Great!..