|        | |||||
|  | |||||
| function | SQLSetArrayAsCounter | ||||
| Related Syntax | Other Library Functions | 
| Library: ODBC Include: omodbc.xin | 
  define external function SQLSetArrayAsCounter
     (  read-only SQL_array_type Array,
        value counter ElementPos,
        value counter CounterValue )
Sets an element in the SQL_array_type variable's data contents to the specified counter value.
Input arguments:
The following code demonstrates how to use SQLSetArrayAsCounter to set the counter value of an element in an SQL array type. 
local SQL_Array_type Array local SQL_Array_type ArrayCopy local counter ArrayCounterValue local counter i SQLSetArraySize( Array, 20, 5 )
The following code checks the counter's initial values.
  set i to 0
  repeat
          set ArrayCounterValue to SQLGetArrayAsCounter ( Array, i )
          output "Initial counter value[%d(i)] = %d(ArrayCounterValue)%n"
          increment i
          exit when i=5
  again
The following code sets the counter values.
  set i to 0
  repeat
          set ArrayCounterValue to (i+1)
          SQLSetArrayAsCounter ( Array, i, ArrayCounterValue )
          increment i
          exit when i=5
  again
The following code checks the counter's current values.
  set i to 0
  repeat
          set ArrayCounterValue to SQLGetArrayAsCounter ( Array, i )
          output "Current counter value[%d(i)] = %d(ArrayCounterValue)%n"
          increment i
          exit when i=5
  again
| ---- |