SIMPOL Documentation

odbc2_fetchandsaverecords()

Description

Adds the output data of an ODBC SQL statement to a specified table. If the return value is not .nul then the function has failed and the string contains information describing the error. After the data is added to the table then there is no attempt to commit the base object; that is the responsibility of the caller. If the function fails at some point then no attempt is made to rollback or commit the records added to the table up to the point of the failure.

Prototype

odbc2_fetchandsaverecords ( type(db1table) table, odbc1connection con, string statement, array parameters, array fields )

Parameters

ParameterDefault valueType nameDescription
tableNonetype(db1table) The table to which new records will be added.
con.nulodbc1connection Specifies the ODBC connection to be used for executing the provided statement.
statement.nulstring The ODBC SQL statement whose output columns will be used to create records which are added to table.
parameters.nularray The parameters, if any, to be passed to ODBC when the statement is executed. If parameters is provided then the parameter values must be stored in consecutive elements starting with parameters[1].
fields.nularray Gives a number of fields that are used to define which values will be set in the newly created records. If fields is not supplied then all 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 table.