DB Tools Insert Data VI
- Updated2024-07-30
- 4 minute(s) read
Inserts a new row into the table in the database identified by the connection reference.

Inputs/Outputs
create table? (F)
—
create table? creates a table if a table does not exist. This VI creates the table with column names provided in the columns input. If the columns input is empty, this VI names the columns Col0, Col1, and so on. This VI determines the type information of the columns created using the data input. If the data input is a cluster, each item in the cluster corresponds to a column that is created in the table.
Note For string column types, the size is set equal to the size of the data.
data
—
data specifies the data you want to insert in the database. If data is a cluster, this VI inserts each item in the cluster to each element in the columns input. The item order of the cluster determines the order how this VI inserts the items to the table. For example, this VI inserts the 0th item to the 0th element of the columns input. If the columns input is empty, this VI inserts the 0th item of the cluster to the first column in table. If data is not a cluster, this VI inserts the data to the column specified by the columns input.
connection reference
—
connection reference specifies a reference to an ADO Connection object.
table
—
table specifies the name of the table in the database in which to insert data. If the create table? input is TRUE, the VI attempts to create the table if it does not already exist.
columns
—
columns is the column in the table to insert data into. Wiring an empty array to this input assumes that all columns in the table are to be used.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
flatten cluster? (F)
—
flatten cluster? specifies whether to insert a cluster that you wire to data as a binary value. If the value is TRUE, this VI updates the column that you specify in the columns input with the flattened binary value of the cluster. If the value is FALSE, this VI updates each column that you specify in the columns input with the corresponding item in the cluster. The default is FALSE. Note This input is valid only if you wire a cluster to the data input.
use file? (F)
—
use file? instructs the VI to use a user-supplied file to determine database types. If you set use file? to FALSE, this VI uses a user-specified file to determine database types. If you set use file? to TRUE, this VI uses the dbtypes.ini file, located in the labview\Database directory, to determine database types. This VI uses use file? only when create table? is TRUE.
connection reference out
—
connection reference out returns a reference to an ADO Connection object.
error out
—
error out contains error information. This output provides standard error out functionality. |
create table? (F)
—
data
—
connection reference
—
table
—
columns
—
error in (no error)
—
connection reference out
—
error out
—