SQL/MP Programming Manual for C
Contents
HP NonStop SQL/MP Programming Manual for C—429847-008
ii
2. Host Variables (continued)
2. Host Variables (continued)
Fixed-Point Data Types 2-11
Date-Time and INTERVAL Data Types 2-13
Using Indicator Variables for Null Values 2-17
Inserting a Null Value 2-17
Testing For a Null Value 2-17
Retrieving Rows With Null Values 2-18
Creating Host Variables Using the INVOKE Directive 2-18
Advantages of Using an INVOKE Directive 2-19
C Structures Generated by the INVOKE Directive 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-24
Treatment in C Statements 2-25
VARCHAR Data Type 2-25
3. SQL/MP Statements and Directives
Embedding SQL Statements 3-1
Coding Statements and Directives 3-1
Placing 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-5
Using a Primary Key Value to Select Data 4-6
Multirow SELECT Statement
4-6
Simple Example 4-7
A More Complex Example
4-7
The Most Complex Example
4-7
INSERT Statement 4-8
Inserting a Single Row
4-9
Inserting a Null Value
4-9
Inserting a Timestamp Value
4-10
UPDATE Statement
4-10
Updating a Single Row 4-11