SQL/MP Programming Manual for COBOL

Memory Considerations
HP NonStop SQL/MP Programming Manual for COBOL529758-003
B-5
Estimating Memory Requirements
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. Some statements require no extra extended memory.
However, other statements generate a run-time call to the SQL executor and do use
extra memory.
Memory Requirements
These structures are shared by all SQL statements and directives:
Use this table to estimate the number of bytes used by each embedded SQL statement
and directive.
Follow these guidelines when you estimate bytes required:
Count a host variable once per occurrence.
Count only these SQL statements and directives (which generate a run-time call to
the SQL executor):
Note. The HP COBOL compiler does not perform checkpointing on data in an extended data
segment. Therefore, to ensure data integrity, HP recommends that you use the NonStop
Transaction Management Facility (TMF).
Structure Bytes Description
SQLCA 430 Count once if you specify the INCLUDE SQLCA directive.
SQLSA 838 Count once if you specify the INCLUDE SQLSA directive.
Bytes Required Description
32 Base value for header information.
+ 72 Base value for each SQL statement with no
host variables.
+ 4 + (24 x number of input host variables) Required for a statement with input host
variables.
+ 4 + (24 x number of output host variables) Required for a statement with output host
variables.
+ 146 Required for a static SQL statement that
uses a cursor declared in the global area of
the program.