Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to create an app which, upon encountering an error while in a reload task, would create a file with the text "error" in it.
So far, I know how to generate a .txt file with STORE into, but I can't find a way to generate the file for every possible error that might be encountered, and I also would like a file with only one line for "Error", instead of the multiple line :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QvdTableHeader>
<QvBuildNo>50689</QvBuildNo>
...
For the error, I know there is ErrorMode, but I would like something that works for all possible errors, and within a reload task.
Is there a way to do it whith ErrorMode, or with something else ?
Best regards.
Maybe something like this added to your script and in sections to capture your error messages.
SET ErrorMode = 0;
LOAD * FROM [YourDataSource.qvd] (qvd);
// Capture error details if the previous load failed
SET vCustomErrMessage = '$(ScriptErrorDetails)';
ErrorLog:
LOAD
Now() as ErrorTimestamp,
'Section Name' as ScriptSection, // Replace with the actual section name
'$(vCustomErrMessage)' as ErrorMessage,
'$(ScriptErrorCount)' as ErrorCount;
Store ErrorLog into ErrorLog.csv (TXT);
Hi @User93
When you get this text
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QvdTableHeader>
<QvBuildNo>50689</QvBuildNo>
It means that when you store your QVD you forget to put in the end of store .qvd(qvd)
Bye!
Maybe something like this added to your script and in sections to capture your error messages.
SET ErrorMode = 0;
LOAD * FROM [YourDataSource.qvd] (qvd);
// Capture error details if the previous load failed
SET vCustomErrMessage = '$(ScriptErrorDetails)';
ErrorLog:
LOAD
Now() as ErrorTimestamp,
'Section Name' as ScriptSection, // Replace with the actual section name
'$(vCustomErrMessage)' as ErrorMessage,
'$(ScriptErrorCount)' as ErrorCount;
Store ErrorLog into ErrorLog.csv (TXT);
Hi @User93
When you get this text
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QvdTableHeader>
<QvBuildNo>50689</QvBuildNo>
It means that when you store your QVD you forget to put in the end of store .qvd(qvd)
Bye!
Thanks !
It does solve the number of lines issue.
Thank you !
After a few tests, I ended with this :
SET ErrorMode = 0;
Load query
if ScriptErrorCount>0 then
File:
Load
'Error' AS [Error]
AutoGenerate 1
;
STORE File Into 'lib://Test/Test_Error.txt'(TXT);
Drop Table File;
end if
And it does work !