SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)

C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL544617-003
15-67
Debugging a Program
Module File Naming
In application development, avoid the use of delimited identifiers that contain dots (.) in
the name of a module’s catalog and schema and in the module name itself. Delimited
identifiers begin and end with double quotation characters (" "). However, quotation
characters are removed when NonStop SQL/MX forms the three-part module name. In
some cases of delimited identifiers that contain dots, the resulting three-part module
name duplicates an unrelated module name, replacing the query execution plans of the
other module file. For example, a module named "A.B".C.D (catalog "A.B", schema
C, and module name D) creates a module file name of
/usr/tandem/sqlmx/USERMODULES/A.B.C.D. A module named A."B.C".D
(catalog A, schema "B.C", and module name D) creates an identically named module
file. The second file overwrites the first, and the first module's application cannot
execute. For more information on delimited identifiers, see the SQL/MX Reference
Manual.
Debugging a Program
You can debug a C/C++ program and its corresponding SQL/MX module by using:
Native Inspect. A system-level command-line symbolic debugger that can be used
to debug TNS/E native programs. For more information, see the Native Inspect
Manual.
Inspect: A symbolic interactive debugger that provides both machine-level and
source-level debugging for TNS/R native programs. To run Inspect in the OSS
environment, enter this command at the OSS prompt:
run -debug -inspect=on sqlprog.exe
where sqlprog.exe is the SQL/MX program you are debugging.
For detailed information, see the Inspect Manual.
Visual Inspect: A symbolic debugger that provides source-level debugging with a
graphical user interface (GUI). Visual Inspect is a client-server application. The
server component runs on an HP NonStop operating system, and the client
component runs on a workstation in the Windows environment. Detailed
documentation is available in the client component online help.
Displaying Query Execution Plans
The EXPLAIN function is an SQL/MX extension that generates a result table describing
an access plan for a DML statement, otherwise known as a query execution plan. Use
the EXPLAIN function for a DML statement in a module. For more information on the
EXPLAIN function, see the SQL/MX Reference Manual and the SQL/MX Query Guide.
Note. If there is no EXPLAIN output for a statically compiled application, the
GENERATE_EXPLAIN default attribute might have been turned off during compilation. In this
case, verify that GENERATE_EXPLAIN is on and recompile the application.