Cicode Programming Reference > Cicode Function Categories > SQL Functions > SQLTraceOn

SQLTraceOn

Turns on a debug trace. Use this function to begin tracing function calls that are made to the database. The information is written to TraceLog.dat file (the strFileName argument is currently ignored). The trace can be turned on globally for all connections or for a specific connection.

Note: Currently the SQL tracing functionality uses the standard SCADA logging mechanism. All SQL traces are Information logs and can be written to TraceLog.dat file only if appriopriate logging ini parameters are set respectively, for example [Debug] SeverityFilterMode.

This function can be called in the foreground or background.

Syntax

SQLTraceOn(sFileName, hSQL, nTraceLevel)

sFileName:

The output file name for the debug trace. Currently ignored.

hSQL:

The handle to the DB connection object: INVALID HANDLE - The trace is activated for all DB connections (default), otherwise - The trace is activated for this specific DB connection object.

nTraceLevel:

Defines the level of details written to the trace file. The following values are allowed:

Return Value

0 (zero) if successful, otherwise an error number is returned. (For details of the 307 error code, call the SQLErrMsg function).

Related Functions

SQLErrMsg, SQLTraceOff, SQLTraceOn

Example

See SQLFieldInfo

See Also

SQL Functions

Published June 2018