0 Replies Latest reply: Aug 18, 2016 5:04 AM by espen skeie RSS

    Creating a table for ERRORCODES

    espen skeie

      Hi

       

      I want to create a table that will tell me something about errorcodes, I have set ErrorMode = 0;

       

      I have tried a couple of different solutions, here is the one using a Sub:
               

       

           Load * From table.qvd (qvd);

       

             If '$(#ScriptError)' <> 0 Then

       

                  Call ErrorCode('$(#ScriptError)', '$(ScriptError)', '$(ScriptErrorDetails)');

        

             End If;

       

       

           Sub ErrorCode(vScriptErrorNumber, vScriptError, vScriptErrorDetails)

       

                  ErrorLog:

                  LOAD

                  '$(vNameOfStock)'           As Ticker,

                  '$(ScriptErrorCount)'         as ScriptErrorCount,

                  vScriptErrorNumber          as ScriptErrorNo,

                  vScriptError                     as ScriptError,

                  vScriptErrorDetails           as ScriptErrorDetails

                  AutoGenerate(1);

       

           End Sub;

       

      It does not work..

       

      //*****************************************************************


      This one does work, but I dont find it very flexible or usable as I will need it many places in my script:

       

           If '$(#ScriptError)' <> 0 Then


                       ErrorLog:

                       LOAD

                       '$(vNameOfStock)'           As Ticker,

                       '$(ScriptErrorCount)'         as ScriptErrorCount,

                       '$(#ScriptError)                 as ScriptErrorNo,

                       '$(ScriptError)                  as ScriptError,

                       '$(ScriptErrorDetails)        as ScriptErrorDetails

                       AutoGenerate(1);

       

           End If;

       

      I have read that the error codes are only available right after the occur, is that correct?

       

      I have also read all threads I could find on the subject....

       

      Best regards
      Espen