Hi,
ScriptErrorDetails does not survive reload or contains info about the last error only (I am using QV 11.2 SR5) .
You have to take the information in it during script run.
ScriptErrorDetails keeps only the detail for the last error that occurred.
For example if you run the script below, you will have only the error detail about the missing txt file even though ScriptErrorCount will be 2.
If you uncomment the last 3 lines the error detail about the Table not Found will also get saved - concatenated to the table ErrorDetailTable.
In similar way you have to save the value of ScriptErrorDetails after each block of code where error may occur and you will have the info you want in the table ErrorDetailTable.
Note that it is written as '$(ScriptErrorDetails)'
Hope this helps;
ErrorMode =0;
MapErrors:
Mapping LOAD * INLINE [
ErrorCode, Errors
0, No error
1, General error
2, Syntax error
3, General ODBC error
4, General OLE DB error
5, General custom database error
6, General XML error
7, General HTML error
8, File not found
9, Database not found
10, Table not found
11, Field not found
12, File has wrong format
13, BIFF error
14, BIFF error encrypted
15, BIFF error unsupported version
16, Semantic error
];
//this should return error - cannot find file user2.txt
Errors:
LOAD ErrorCode, Errors
FROM
(txt, codepage is 1251, embedded labels, delimiter is ' ', msq);
//this will create table to keep the info about the last error that has occurred
ErrorDetailTable:
LOAD ApplyMap('MapErrors','$(ScriptError)') as ErrorType,
'$(ScriptErrorDetails)' as ErrorDetails
AutoGenerate(1);
//this should give another error - Table not found, no other details here
DROP TABLE TTT;
//uncomment this to save the information about the second error as well
//LOAD ApplyMap('MapErrors','$(ScriptError)') as ErrorType,
// '$(ScriptErrorDetails)' as ErrorDetails
//AutoGenerate(1);