SIMPOL Documentation

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



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.


odbc2_addodbcrecord ( odbc1connection con, type(db1table) table, string name, array fields, type(db1record) record )


ParameterDefault valueType nameDescription
conNoneodbc1connection Specifies the ODBC connection on which the destination table is present.
table.nultype(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.nulstring 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.nularray 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.nultype(db1record) A record whose data is to be inserted into the destination ODBC table.