skip to main content
Designing and coding the IP : Insert processing
 

Insert processing

Implementing INSERT processing in your IP is different than SELECT, UPDATE or DELETE processing. Instead of searching for rows that match the WHERE condition, you simply take the values that are provided by the OpenAccess SDK SQL engine and insert them into your data source.
Insert processing is implemented by using the functions dam_getFirstInsertRow and dam_getNextInsertRow to navigate through the list of rows to insert. OpenAccess SDK SQL engine returns the insert values as a column-value pair. Navigation through the columns of an insert row is done by using the dam_getFirstValueSet and dam_getNextValueSet functions. The data and the column handle are retrieved by using the dam_getValueToSet and dam_getColToSet functions.
Use the functions dam_getFirstInsertRow and dam_getNextInsertRow to walk through insert row values. OpenAccess SDK provides an extension to the INSERT command that allows multiple row values to be supplied in a single INSERT query. Use dam_getFirstValueSet and dam_getNextValueSet to walk through the columns that are specified in the query.
For each DAM_HROWELEM, use dam_getColToSet to get details about the column, and dam_getValueToSet to get the column’s value. See example1, which is installed with OpenAccess SDK, for sample INSERT processing code.