Progress
Embedded SQL-92
Guide and Reference
Using Indicator Variables with INPUT Host Variables
You can use indicator variables with INPUT host variables. You can assign a NULL value to a column when you INSERT a row into a table or when you UPDATE a table column that allows NULL values.
The code fragment in the following example shows how to declare and use an indicator variable in an INSERT statement. The host variables in this example are: order_no_v, order_date_v, product_v, and qty_v. The indicator variable qty_i is associated with the qty_v host variable. The optional INDICATOR keyword identifies qty_i as an indicator variable.
EXAMPLEThe code fragment illustrates these steps:
- DECLARE host variables and one indicator variable in the DECLARE SECTION.
- Set the indicator variable to the value -1 in a C Language section; do not prepend a colon in native C Language statements.
- INSERT a row into the orders table; set the qty column to NULL; prepend a colon to each host variable and indicator variable in this executable statement.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |