Trace Method for an Application
The Trace method appends a message to the trace file. Trace helps to debug an SQL query and to monitor how Siebel CRM allocates objects. This method does not return any information.
This tracing is not the same as the tracing that you can activate in the Siebel application configuration (CFG) file. For more information, see Tracing a Script.
It is recommended that you do not use the Trace method or the TraceOn method in a production environment. For more information, see TraceOn Method for an Application.
Format
Application.Trace(message)
The following table describes the arguments for the Trace method.
Argument | Description |
---|---|
message |
String variable or literal that contains message text that Siebel CRM appends to the trace file. |
Used With
COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script
Examples
The following example is for COM Data Server:
Private Sub TraceOn_Click()
Dim ErrCode As Integer
SiebelApplication.TraceOn "c:\temp\trace.txt", "allocation", _
"all", ErrCode
If (ErrCode = 0) Then SiebelApplication.TraceOn
"c:\temp\trace.txt", "SQL", "",ErrCode
If (ErrCode = 0) Then SiebelApplication.Trace
"Start of Tracing!",
ErrCode
End Sub
The following example is in Siebel VB:
Sub Button2_Click
TheApplication.TraceOn "C:\temp\trace.txt", "allocation", "all"
TheApplication.TraceOn "C:\temp\trace.txt", "sql", ""
TheApplication.Trace "start of tracing!"
End Sub
Example Trace Output
The following is example output of an Allocation trace section:
03/05/98,17:27:47,START,4.0.4 [1425_P3] ENU
03/05/98,17:27:47,ALLOC,1,BusObject,Account,Basic
03/05/98,17:27:48,ALLOC,2,BusComp,Account,Basic
03/05/98,17:27:48,RELEASE,1
03/05/98,17:27:48,RELEASE,2
The following is example output of an SQL trace section:
01/22/98,21:03:49,START,4.0.2 [1416] ENU
01/22/98,21:04:02,COMMENT,Start of Tracing!
01/22/98,21:04:10,SQLSTMT,1,SELECT,"SELECT
T1.ROW_ID,
T1.MODIFICATION_NUM,
T1.CREATED_BY,
T1.LAST_UPD_BY,
T1.CREATED,
T1.LAST_UPD,
T1.CONFLICT_ID,
T1.NAME,
T1.DESC_TEXT,
T1.PRIV_FLG,
T1.QUERY_STRING
FROM
DEV32.S_APP_QUERY T1
WHERE
(T1.CREATED_BY = :1 OR T1.PRIV_FLG = :2) AND
((T1.NAME LIKE :3 OR T1.NAME LIKE :4 OR T1.NAME LIKE :5 OR
T1.NAME LIKE :6) AND UPPER(T1.NAME) = UPPER(:7))
ORDER BY
T1.NAME, T1.DESC_TEXT"
01/22/98,21:04:10,SQLBIND,1,1,1-6NF
01/22/98,21:04:10,SQLBIND,1,2,N
01/22/98,21:04:10,SQLBIND,1,3,ac%
01/22/98,21:04:10,SQLBIND,1,4,Ac%
01/22/98,21:04:10,SQLBIND,1,5,aC%
01/22/98,21:04:10,SQLBIND,1,6,AC%
01/22/98,21:04:10,SQLBIND,1,7,Account
Related Topics
For more information, see the following topics: