OpenAPI User Guide > OpenAPI User Guide > OpenAPI Function Reference > OpenAPI Functions > IIapi_putColumns() Function--Send Data to Server to Copy Data from File to Database Table
Was this helpful?
IIapi_putColumns() Function--Send Data to Server to Copy Data from File to Database Table
The IIapi_putColumns() function takes the requested number of columns of data from the application's buffers and copies it to a database table.
This function is preceded with the IIapi_getCopyMap() function, which describes the format and number of columns to be copied.
IIapi_putColumns() processes columns sequentially in the order that they appear in the row, as described in the IIapi_getCopyMap() functions. The application requests that a whole row be sent with one call to IIapi_putColumns(), provided it does not contain any long varchar or long byte columns. However, IIapi_putColumns() cannot span rows, so the application cannot request a number greater than the number of columns in a row.
If one of the columns is a long varchar or long byte that requires more than one segment to be sent, the application sends the columns individually with single calls to IIapi_putColumns(). For example, a row of ten columns with a long varchar or long byte spanning multiple segments as the fifth column is handled as follows. The application:
1. Sends four columns with a call to IIapi_putColumns().
2. Sends one segment of the long varchar or long byte column with a call to IIapi_putColumns().
3. Continues sending individual segments until all are sent.
4. Sends five columns with a call to IIapi_putColumns() to send the rest of the columns of the current row.
This function has the following syntax:
II_VOID IIapi_putColumns (IIAPI_PUTCOLPARM *putColParm);
typedef struct _IIAPI_PUTCOLPARM
{
       IIAPI_GENPARM       pc_genParm;
       II_PTR              pc_stmtHandle;
       II_LONG             pc_columnCount;
       IIAPI_DATAVALUE     *pc_columnData;
       II_BOOL             pc_moreSegments;
} IIAPI_PUTCOLPARM;
This function has the following parameters:
pc_genParm
Type: input and delayed output
Specifies the generic parameters. For a description, see Generic Parameters).
pc_stmtHandle
Type: input
Specifies the statement handle identifying the copy from statement.
pc_columnCount
Type: input
Specifies the number of columns the application is sending to the server.
pc_columnData
Type: input
Specifies an array of buffers containing the data to be sent to the server. The number of buffers in this array must be equal to the value of pc_columnCount.
pc_moreSegments
Type: input
Indicates whether there is more data to be sent for a column of a long varchar or long byte data type. This parameter is set to TRUE if the data type is long varchar or long byte and more data must be sent for the current column; otherwise, the parameter is set to FALSE.
Last modified date: 04/03/2024