How to export SQL errors to a text file?

Caché, SQL


Do you know how to export SQL errors to a text file from a terminal session in Caché?


  • 0
  • 0
  • 157
  • 3
  • 0


To be more precise, I'm doing a data migration with the management portal wizard.

I get SQL errors I would like to export.

Hi Blaise. There is query ErrorLog in %CSP.UI.System.BackgroundTask class so you can print errors like follows:

USER>do ##class(%ResultSet).RunQuery("%CSP.UI.System.BackgroundTask","ErrorLog",3932)

3932 here is task id.

And print errors to file:

USER>set file="c:\temp\sqlerrors.txt"
USER>open file:"NW":5
USER>use file do ##class(%ResultSet).RunQuery("%CSP.UI.System.BackgroundTask","ErrorLog",3932)
USER>close file

Notice that %CSP.UI.System.BackgroundTask is marked for internal use only.