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

Contents
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
ii
1. Introduction (continued)
1. Introduction (continued)
Processing Exception Conditions 1-9
Checking SQLSTATE 1-9
Using WHENEVER 1-9
Using GET DIAGNOSTICS 1-10
Ensuring Data Consistency 1-10
Compiling and Building an Application 1-11
Processing With Embedded Module Definitions 1-11
Processing With Module Definition Files 1-12
General Instructions 1-12
SQL/MX Host Language Preprocessor 1-12
SQL/MX Compiler 1-13
Host Language Compiler 1-13
Program and Module Management 1-14
2. Embedded SQL Statements
Syntax for Coding SQL Statements 2-1
Guidelines for Coding SQL Statements 2-1
Placement of SQL Statements 2-2
MODULE Directive 2-2
Host Variable Declarations 2-2
Nonexecutable SQL Statements 2-4
Executable SQL Statements 2-4
Embedded SQL Declarations and Statements 2-6
Considerations for Embedding DDL and DML Statements 2-12
Considerations for Embedding the UPDATE STATISTICS Statement 2-12
Using CONTROL Statements 2-12
ANSI Compliance and Portability 2-13
Static and Dynamic CONTROL Statements 2-13
CONTROL, Line Order Scope, and Static SQL programs 2-13
CONTROL, Flow Control Scope, and Dynamic SQL programs 2-13
3. Host Variables in C/C++ Programs
Specifying a Declare Section 3-1
C Host Variable Data Types 3-2
Character Host Variables 3-2
Date-Time and Interval Host Variables 3-4
Numeric Host Variables 3-5
Floating-Point Host Variables 3-6