For the most part, a JDA WMS Developer either uses a front-end client like JDA SCE Client or Telnet client for RF screens to emulate RF guns or a back-end client like Oracular MOCA Client or LextEdit. But there are times when a MOCA Developer has to get their hands dirty and use the command line utility — MSQL. This utility is generally used to either test connectivity from the Application Server to the Database Server or to execute certain commands directly or to execute saved scripts located on the Application Server having the msql file extension. However, there can be times, especially during an upgrade/implementation where all other clients are not usable for tracing or the trace is too large making it more difficult for you to understand the underlying issue or you’re running a piece of complex logic and only want to trace a certain process of the workflow, or user(s) having issues while connecting to the Application or a MOCA command is returning an error during the “log on” process or if a developer is coding a custom module for LDAP/AD authentication and wants to test the user “log on” process or somehow the login process has broken. What do you do then? How do you trace it?
Well, this is where the MSQL Utility comes in handy. You can simply use the following script to manually trace a process or command:

Where you can set trace level flags based on the following information:
W = Application Flow Message
S = SQL Calls
M = Connection Manager Flow Messages
X = Server Flow Messages
A = Server Arguments
R = Performance Statistics
P = Print process ID in trace messages
C = Command Profiling
Word of advice, please setup arg-blacklist parameter in the [SERVER] section of the registry to avoid other resources looking at the password you enter to prevent any unauthorized access or exposure.
Argument usr_pswd displaying password entered by User:

Argument usr_pswd blacklisted after changing the registry and restarting the JDA WMS Instance:

Copy/paste the following code into your MOCA Client:
set trace
where activate = 1
and trclvl = '*'
and mode = 'w'
and filename = 'DBGUI9999.log'
;
INSERT CODE YOU WANT TO TRACE
;
set trace where activate = 0
and trclvl = '0'
To validate if trace has stopped, you can always run the following command to validate:
get current trace levels
