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

Contents
HP NonStop SQL/MX Programming Manual for C and COBOL544617-003
vii
9. Dynamic SQL (continued)
9. Dynamic SQL (continued)
Deallocate the Prepared Statement 9-7
Using EXECUTE IMMEDIATE 9-7
Setting Default Values Dynamically 9-8
10. Dynamic SQL With Descriptor Areas
Statements for Dynamic SQL With Descriptors 10-1
SQL Descriptor Areas 10-2
SQL Item Descriptors 10-2
Allocating an SQL Descriptor Area 10-3
Deallocating an SQL Descriptor Area 10-3
Input Parameters 10-3
Describing Input Parameters 10-4
Setting the Data Values of Input Parameters 10-4
Setting Input Parameter Information Without DESCRIBE INPUT 10-6
Output Variables 10-7
Describing Output Variables 10-7
Getting the Values of Output Variables 10-7
Consideration—Retrieving Multiple Values From a Large Buffer 10-8
Steps for Using SQL Item Descriptor Areas 10-12
Declare a Host Variable for the Dynamic SQL Statement 10-14
Construct the SQL Statement From User Input 10-14
Allocate Input and Output SQL Descriptor Areas 10-14
Prepare the SQL Statement 10-15
Describe the Input Parameters and the Output Variables 10-15
Set Explicit Input Values 10-16
Execute the Prepared Statement 10-18
Get the Count and Descriptions of the Output Variables 10-19
Deallocate the Prepared Statement and the SQL Descriptor Areas 10-20
Using SQL Descriptor Areas to Select SQL/MP KANJI and KSC5601 Data 10-21
Using SQL Descriptor Areas to Retrieve ISO88591 Data to UCS2 Host
Variables 10-21
11. Dynamic SQL Cursors
Statements for Dynamic SQL Cursors 11-1
Steps for Using a Dynamic SQL Cursor 11-2
Declare Required Host Variables 11-4
Prepare the Cursor Specification 11-4
Declare the Cursor 11-4