SQL/MP Programming Manual for COBOL

Contents
HP NonStop SQL/MP Programming Manual for COBOL529758-003
ii
2. Host Variables (continued)
2. Host Variables (continued)
Numeric Data 2-8
Using COBOL Data Description Clauses 2-9
Using Date-Time and INTERVAL Data Types 2-9
Using Indicator Variables for Null Values 2-11
Inserting a Null Value 2-11
Testing for a Null Value 2-12
Retrieving Rows With Null Values 2-13
Creating Host Variables Using the INVOKE Directive 2-14
Advantages of Using an INVOKE Directive 2-14
COBOL Record Descriptions 2-15
Embedded Sign in a Decimal Data Type 2-18
System-Defined Primary Key (SYSKEY) 2-18
Date-Time and INTERVAL Data Types 2-19
Using Indicator Variables With the INVOKE Directive 2-22
Using INVOKE With SQLCI 2-24
Associating a Character Set With a Host Variable 2-25
Treatment in COBOL Statements 2-26
VARCHAR Data Type 2-26
3. SQL/MP Statements and Directives
Embedding SQL Statements 3-1
Coding SQL Statements and Directives 3-1
Placing SQL Statements and Directives 3-2
Finding Information 3-3
4. Data Retrieval and Modification
Opening and Closing Tables and Views 4-2
Causes of SQL Error 8204 (Lost Open Error) 4-2
Recovering From SQL Error 8204
4-3
Single-Row SELECT Statement 4-4
Using a Column Value to Select Data
4-4
Using a Primary Key Value to Select Data
4-5
Using IN SHARE MODE or IN EXCLUSIVE MODE 4-6
INSERT Statement
4-6
Inserting a Single Row
4-7
Inserting a Null Value
4-7
Inserting a Timestamp
4-8
UPDATE Statement 4-8