SQL/MP Programming Manual for C

Memory Considerations
HP NonStop SQL/MP Programming Manual for C429847-008
B-3
Estimating Memory Requirements
These structures are shared by all SQL statements and directives in a program:
Use Table B-2 to estimate the memory used by each SQL statement and directive.
Follow these guidelines when you use Table B-2:
Count a host variable once per occurrence.
Count these SQL statements and directives (which generate a run-time call to the
SQL executor):
Do not count these SQL statements and directives:
BEGIN DECLARE SECTION and END DECLARE SECTION
CONTROL EXECUTOR, CONTROL QUERY, and CONTROL TABLE
DECLARE CURSOR
INVOKE
WHENEVER
Structure Bytes Description
SQLCA 430 Count once if you specify the INCLUDE SQLCA directive.
SQLSA 838 or
1790
Count once if you specify the INCLUDE SQLSA directive. A
version 330 or later SQLSA structure is 1790 bytes; older SQLSA
structures are 838 bytes.
Table B-2. Virtual Memory Requirements for SQL Statements
Bytes Required Description
72 Base value for a statement with no host
variables
+ 4 + (24 * number of input host variables) Required for a statement with input host
variables
+ 4 + (24 * 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
ALTER
BEGIN WORK
CLOSE
COMMENT
CREATE
DELETE
DESCRIBE
DESCRIBE INPUT
DROP
END WORK
EXECUTE
EXECUTE IMMEDIATE
FETCH
FREE RESOURCES
GET VERSION
HELP TEXT
INSERT
LOCK TABLE
OPEN
RELEASE
ROLLBACK WORK
SELECT
UNLOCK TABLE
UPDATE
UPDATE STATISTICS