Memory Considerations
HP NonStop SQL/MP Programming Manual for C—429847-008
B-2
Using the SQLMEM Pragma
Using the SQLMEM Pragma
For programs that use the large-memory model and are compiled on TNS systems, the
SQLMEM pragma specifies where in memory the C compiler should place the SQL
internal data structures. Use this syntax for the SQLMEM pragma:
USER
causes the C compiler to allocate the SQL data structures in the user data space,
which is the global area addressable with 16 bits. Although the USER option can
improve access time to the SQL structures, specify USER only if the global area
can hold the specific structures.
EXT
causes the C compiler to place the SQL data structures in an extended data
segment. EXT is the default.
Follow these guidelines when you use the SQLMEM pragma:
The SQLMEM pragma applies only to the C compiler on TNS systems. The NMC
compiler on TNS/R systems ignores this pragma.
The SQLMEM pragma is valid only for the large-memory model, which is the
default for the C compiler. If you specify SQLMEM for the small-memory model
(NOXMEM pragma) on a TNS system, the C compiler returns error 172.
To specify the SQLMEM pragma in your program, you must first specify the SQL
pragma. Otherwise, the C compiler returns error 173 (illegal SQLMEM option).
Use the SQLMEM pragma as many times as necessary in your program to control
the placement of SQL data structures.
Estimating Memory Requirements
A program that uses embedded SQL statements and directives to access an SQL/MP
database uses more memory than a program that accesses an Enscribe database.
This subsection describes how to estimate the virtual memory used by embedded SQL
statements and directives in a program’s extended data segment.
Some statements require no extra extended memory, but other statements generate a
run-time call to the SQL executor and use the extra memory. The SQL executor uses
extended memory to run and uses the memory shown in this table for parameters and
data structures.
SQLMEM { USER | EXT }