Thank you, Evgeny, for pointing out how to update user(s) by using CPF Merge. I still like to have an option to configure a group of users in a single file and import this group of users with their passwords into several different IRIS instances which may use different CFP Merge files already. If there is a change to my users, I just update the XML file which gets imported using %ZSTART routine whenever any IRIS instance starts.

The error from Prepare will write to messages.log with this change:

Class otw.dynq

{

ClassMethod prepareQ() As %Status

{

    Set result=##class(%ResultSet).%New("%DynamicQuery:SQL")

    Set sc=result.Prepare("SELECT %ID, Name, Salary FROM Sample.Employee WHERE Salary > ?")

    If $$$ISERR(sc) {

        // here I want to capture the error details in trace , log , that I can see in production web page

        Try {

            Set x = $System.Status.GetOneStatusText(sc)

            Do ##class(%SYS.System).WriteToConsoleLog("otw.dynq prepareQ: "_x)

        } Catch exception {

            Do BACK^%ETN // Log error in error log

        }

    }

    Quit sc

}

}