Chapter 14. The ODBC Client Companion Library
This chapter contains information that is specific to the SIMPOL language
companion library odbc2.sml
. To use
these features you must make sure that the ODBC component is added to your
project and that the odbc2.sml
file
is added as a library file to your project.
Provides functions to perform basic table creation and data transfer between an ODBC connection and native simpol db1* database objects
odbc2_addodbcrecord()
Description
Copies the data from the supplied record to the specified table on an
ODBC connection. If the return value is not .nul
then
the function has failed and the string contains information describing
the error.
Prototype
odbc2_addodbcrecord
(
odbc1connection
,
type(db1table) con
,
string table
,
array name
,
type(db1record) fields
)
record
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
con | None | odbc1connection | Specifies the ODBC connection on which the destination table is present. |
table | .nul | type(db1table) |
Gives an object representing a table which will be used to provide
information to identify the table on the ODBC connection to which the
new row will be added. If table is not supplied,
or is .nul , then name and
fields must be supplied. If
table is supplied then it must be the table from
which record has been selected.
|
name | .nul | string |
Gives the name of the ODBC table to have the data from
record inserted. If no name is supplied then the
name of table is used.
|
fields | .nul | array |
Gives a number of fields which are used to define which values from
record are to be transferred to the ODBC table. If
fields is not supplied then the fields of
table are used. If fields is
supplied then fields[] must contain the number of
fields being supplied, and a consecutive sequence of elements of
fields , starting at fields[1] ,
must contain references to the fields to use. Each of these fields
must belong to the table from which record has
been selected.
|
record | .nul | type(db1record) | A record whose data is to be inserted into the destination ODBC table. |