|
||||||||||
|
||||||||||
Related Syntax | Other Library Functions |
function | SQLSetArrayAsCounterShelf |
Library: omodbc - low-level ODBC support
Include: omodbc.xin |
define external function SQLSetArrayAsCounterShelf ( read-only SQL_array_type Array, read-only integer InputShelf, value integer ItemCount )
Sets elements in the SQL_array_type variable's data contents to the specified integer shelf items.
Input arguments:
The following code demonstrates how to use SQLSetArrayAsCounterShelf
to set the value of the SQL array integer:
local SQL_Array_type Array local integer ArrayCounterShelf variable local integer i SQLSetArraySize( Array, 20, 5 ) ; ; Check initial values. ; SQLGetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) repeat over ArrayCounterShelf output "Initial integer shelf value[%d(#ITEM)] = %d(ArrayCounterShelf)%n" again ; ; Set integer values. ; set i to 0 repeat set ArrayCounterShelf@(i+1) to (2*(i+1)) increment i exit when i=5 again SQLSetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) ; ; Check current values. ; SQLGetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) repeat over ArrayCounterShelf output "Current integer shelf value[%d(#ITEM)] = %d(ArrayCounterShelf)%n" again
The following code demonstrates how to set the integer values of multiple elements in an SQL array type:
local SQL_Array_type Array local integer ArrayCounterShelf variable local integer i SQLSetArraySize( Array, 20, 5 ) ; ; Check initial values. ; SQLGetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) repeat over ArrayCounterShelf output "Initial integer shelf value[%d(#ITEM)] = %d(ArrayCounterShelf)%n" again ; ; Set integer values. ; set i to 0 repeat set ArrayCounterShelf@(i+1) to (2*(i+1)) increment i exit when i=5 again SQLSetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) ; ; Check current values. ; SQLGetArrayAsCounterShelf( Array, ArrayCounterShelf, 5 ) repeat over ArrayCounterShelf output "Current integer shelf value[%d(#ITEM)] = %d(ArrayCounterShelf)%n" again
---- |