|
|||||||||||
|
The SQL_Array_type OMX component, in conjunction with the SQL_Handle_type
and SQL_Vector_type
OMX components, allow you to access an ODBC-compliant database from within an OmniMark program. The SQL_Array_type OMX component acts as an interface between OmniMark data and ODBC two-dimensional arrays.
The OmniMark ODBC dynamic link library file ("omodbc.dll" or "omodbc.so") creates the SQL_Array_type OMX component. The ODBC library include file ("omodbc.xin") defines the interface to that component. To use SQL_Array_Type and the other SQL OMX components, you must include the following declaration and include statement in your program:
include "omodbc.xin"
Within your program, you can create as many instances of the SQL_Array_type component as required to meet the needs of your program. This can be done simply by declaring global and local variables of type "SQL_Array_type". For example:
; required declaration and include statements include "omodbc.xin" ; global SQL_Array_type declarations global SQL_Array_type mysqlarray-1 global SQL_Array_type mysqlarray-2 process ;local SQL_Array_type declarations local SQL_Array_type mysqlarray-3 local SQL_Array_type mysqlarray-4
Once you have declared your SQL_Array_type variables, you manipulate them using the functions in the OmniMark ODBC function library.
The SQL_Array_type OMX component is not copyable. This means that if you set the value of one SQL_Array_type variable to the value of another SQL_Array_type variable, you end up with two variables pointing at the same external object. You are able to manipulate both variables, but you are performing those manipulations on the same external object, whether you use the original SQL_Array_type OMX variable or its copy. For example:
process ;local SQL_Array_type declarations local SQL_Array_type mysqlarray-3 local SQL_Array_type mysqlarray-4 ;set the initial values of the variables SQLSetArraySize (mysqlarray-3, 50, 1) SQLSetArraySize (mysqlarray-4, 50, 2) ;creating the duplicate instance set mysqlarray-4 to mysqlarray-3
This example creates two SQL_Array_type variables, and sets a value for each of them. However, the value for "mysqlarray-4" is set to the same value as "mysqlarray-3". This does not set the value of "mysqlarray-4", but rather changes it so that it points to "mysqlarray-3" instead. Thus, any manipulations performed on either variable will be reflected in the value of both variables.
---- |