SQL Programming Manual for TAL

Program Compilation and Execution
HP NonStop SQL Programming Manual for TAL527887-001
5-33
Estimating Program Size
These structures are shared by all SQL statements and directives in a program:
Use this table to estimate the number of bytes used by each embedded SQL statement
and directive in the extended data segment.
Follow these guidelines when you use this table:
Count a host variable once per occurrence.
Count only these SQL statements and directives (which generate a run-time call to
the SQL executor):
Do not count:
BEGIN DECLARE SECTION and END DECLARE SECTION
CONTROL EXECUTOR, CONTROL QUERY, and CONTROL TABLE
DECLARE CURSOR
INVOKE
WHENEVER
Bytes Structure Description
430 SQLCA Count once if you specify INCLUDE SQLCA
838 SQLSA Count once if you specify INCLUDE SQLSA
Table 5-1. Calculating Virtual Memory Requirements for Each SQL Statement or
Directive
Bytes Required Description of SQL Statement
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 DROP LOCK TABLE
BEGIN WORK END WORK OPEN
CLOSE EXECUTE RELEASE
COMMENT EXECUTE IMMEDIATE ROLLBACK WORK
CREATE FETCH SELECT
DELETE FREE RESOURCES UNLOCK TABLE
DESCRIBE HELP TEXT UPDATE
DESCRIBE INPUT INSERT UPDATE STATISTICS