This function collects in an SQL trace file the SQL trace information for an executed UAP.
If an SQL error occurs during UAP execution, the SQL trace information can be used to identify the SQL statement that caused the error.
When the current SQL trace file becomes full, a new file is swapped in and the previous information in that file can be overwritten.
SQL trace information is collected by setting values in the PDCLTPATH and PDSQLTRACE environment variables during client environment definition. For details about the client environment definition, see 6.6 Client environment definitions (setting environment variables).
The two SQL trace files in which information is collected are created under a specified directory. The file names that are created depend on whether or not an API (TX_function) conforming to X/Open is used.
Table 10-1 shows the relationship between the TX_function and the files that are created.
Table 10-1 Relationship between the use of an API (TX_function) conforming to X/Open and created SQL trace files
Use of TX_function | Created SQL trace files |
---|---|
No | pdsql1.trc and pdsql2.trc |
Yes | pdsqlxxxxx-1.trc and pdsqlxxxxx-2.trc |
SQL trace information is output after the execution of SQL statements is completed. An example of output of SQL trace information is shown as follows, followed by an explanation.
[20] [19] [22] |
Operation code | Corresponding SQL statement |
---|---|
AUI2 | DELETE statement (static SQL), INSERT statement (static SQL), UPDATE statement (static SQL), LOCK statement (static SQL), PURGE TABLE statement (static SQL), single-row SELECT statement (static SQL), FREE LOCATOR statement (static SQL) |
AUI3 | Assignment statement (static SQL) |
AUX | EXECUTE statement |
AUXI | EXECUTE IMMEDIATE statement, all definition SQL statements |
AUXO | EXECUTE statement (INTO specified) |
CALL | CALL statement |
CLOS | CLOSE statement |
CMIT | COMMIT statement |
CNCT | CONNECT statement |
CPRP | Commit prepare* |
DESC | DESCRIBE statement (OUTPUT specified) |
DEST | DESCRIBE TYPE statement |
DISC | DISCONNECT statement, COMMIT statement (RELEASE specified) |
DISR | ROLLBACK statement (RELEASE specified) |
DIST | Disconnect + Tran Check* |
DSCM | Used by the system. |
DSPR | Used by the system. |
DSRL | Used by the system. |
FETC | FETCH statement |
GETD | GET DIAGNOSTICS |
HVAR | DESCRIBE statement (INPUT specified) |
JARI | INSTALL JAR |
JARR | REPLACE JAR |
JARU | REMOVE JAR |
OPEN | OPEN statement (dynamic SQL) |
OPN2 | OPEN statement (static SQL) |
OPNR | OPEN statement (dynamic SQL (multiple cursors)) |
RENV | Used by the system. |
RNCN | CONNECT statement (TO specified) |
RNDS | DISCONNECT statement (TO specified) |
RNSC | SET CONNECTION statement |
ROLL | ROLLBACK statement |
RSDC | DESCRIBE statement (OUTPUT and RESULT SET specified) |
RSFT | FETCH statement (RESULT SET specified) |
RSCL | CLOSE statement (RESULT SET specified) |
SAUT | SET SESSION AUTHORIZATION statement |
SET | PREPARE statement |
SINF | Used by the system. |
SOPT | Used by the system. |
SVLS | Used by the system. |
THRE | Used by the system. |
THSU | Used by the system. |
TRCK | Used by the system. |
TRC2 | Used by the system. |
TRST | Used by the system. |
TSCM | Used by the system. |
TSRL | Transfer Rollback* |
TSPR | Transfer Prepare* |
ALCR | ALLOCATE CURSOR statement |
DSET | DEALLOCATE PREPARE statement |
Platform | Character string to be displayed |
---|---|
HP-UX 11.0 | HP32 |
HP-UX 11.0 (64-bit mode) | HP64 |
Solaris | SOL |
Solaris (64-bit mode) | SOL64 |
AIX 5L | AIX |
AIX 5L (64-bit mode) | AIX64 |
Linux | LINUX |
Windows | WIN32 |
HP-UX (IPF) 32-bit mode | HPI32 |
HP-UX (IPF) 64-bit mode | HPI64 |
Linux (IPF) | LINI64 |
Linux (EM64T) | LINX64 |
Windows Server 2003 (IPF) | WINI64 |
Windows (x64) 64-bit mode | WINX64 |
Type4 JDBC driver | Type4 |
Library name | Displayed characters |
---|---|
libzclt.sl, libclt.a | UNIX, UNIX_32 |
libzclts.sl, libclts.a | UNIX_S, UNIX_32S |
libzcltm.sl, libcltm.a | UNIX_M, UNIX_32M |
libzcltk.sl, libcltk.a | UNIX_K, UNIX_32K |
libzcltx.sl, libcltxa.a | UNIX_XA, UNIX_XA_32 |
libzcltxs.sl, libcltxas.a | UNIX_XA_S, UNIX_XA_32S |
libzcltxm.sl, libcltxam.a | UNIX_XA_M, UNIX_XA_32M |
libzcltxk.sl, libcltxak.a | UNIX_XA_K, UNIX_XA_32K |
libzclt64.sl, libclt64.a | UNIX_64 |
libzcltk64.sl, libcltk64.a | UNIX_64K |
libzclts64.sl | UNIX_64S |
libzcltx64.sl, libzclty64.sl | UNIX_XA_64 |
libzcltxk64.sl, libzcltyk64.sl | UNIX_XA_64K |
libzcltxs64.sl, libzcltys64.sl | UNIX_XA_64S |
CLTDLL.DLL | WIN_32 |
PDCLTM32.DLL | WIN_M32 |
PDCLTM50.DLL | WIN_M50 |
PDCLTP32.DLL | WIN_P32 |
PDCLTX32.DLL | WIN_XA_32 |
PDCLTXM.DLL | WIN_XA_32M |
PDCLTXS.DLL | WIN_XA_32S |
PDCLTXM5.DLL | WIN_XA_50M |
PDCLTM64.DLL | WIN_M64 |
PDCLTX64.DLL | WIN_XA_64 |
PDCLTXM64.DLL | WIN_XA_64M |
PDCLTXS64.DLL | WIN_XA_64S |
PDJDBC2.JAR | Type4 |
If the SQL trace file becomes full while SQL trace information is being output, HiRDB stops writing to that file and outputs SQL trace information to another SQL trace file. Any information that already exists in the switched-in SQL trace file is overwritten in chronological order by the new SQL trace information. To prevent that information from being lost, copy the contents of the SQL trace file into a backup file whenever execution of a UAP is completed.
To determine the SQL trace file that is being used currently, check the most recent update dates/times of the files. The SQL trace file that was updated most recently is the current file.
For a Windows version HiRDB client, you use the dir command or the Explorer to check the file update dates/times.
For a UNIX version HiRDB client, you use the OS's 1s -1 command to check the file update dates/times.
Output examples of representative parameter traces are shown below.