Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm facing a problem right now where I need to log the errors that we're getting from our QVWs. I don't have any problem in storing the ScriptErrorCount and ScriptErrorDetails but having a problem on storing the ScriptErrorList to QVD.
The ScriptErrorList value look like this:
Field Not Found
General Error
General Error
Table Not Found
I try to store it using the following code:
LET vErrorDetail = ScriptErrorDetails;
LET vScriptErrorCount = ScriptErrorCount;
LET vErrorList = ScriptErrorList;
LET vErrorDate = Date(Now(),'YYYY-MM-DD hh:mm:ss');
LET vQVWName = DocumentName();
ErrorLogs:
LOAD '$(vQVWName)' AS [QVWName],
'$(vScriptErrorCount)' AS [ErrorCount],
Replace($(vErrorList),chr(10),chr(44)) AS [ErrorList],
'$(vErrorDetail)' AS [ErrorDetail],
'$(vErrorDate)' AS ErrorDate
AutoGenerate (1)
STORE ErrorLogs INTO QVWErrorLogs.qvd;
But the result in QVD looks like this:
QVWName | ErrorCount | ErrorList | ErrorDetail | ErrorDate |
---|---|---|---|---|
QVWName.qvw | 4 | Field Not Found | Table not found | 2016-06-09 10:22:56 |
What I want to see is somewhat looks like this:
QVWName | ErrorCount | ErrorList | ErrorDetail | ErrorDate |
---|---|---|---|---|
QVWName.qvw | 4 | Field Not Found, General Error, General Error, Table Not Found | Table not found | 2016-06-09 10:22:56 |
Any help would be greatlty appreciated.
Thanks
You will need '' around the $(vErrorList) and as Rakesh suggested, if your intent is to replace the newlines with commas, use
Replace('$(vErrorList)',chr(13)& chr(10),chr(44)) AS [ErrorList]
-Rob
why not generate a logfile and use that as input?
regards Joris
Please try this:
replace(ScriptErrorList,chr(13) & chr(10), chr(44))
You will need '' around the $(vErrorList) and as Rakesh suggested, if your intent is to replace the newlines with commas, use
Replace('$(vErrorList)',chr(13)& chr(10),chr(44)) AS [ErrorList]
-Rob