Example Code

Insert Data into DataBase from an Array using LabVIEW Database Connectivity Toolkit

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Database Connectivity Toolkit
  • LabVIEW

Code and Documents

Attachment

Overview

This example inserts data into a database from an array in LabVIEW using the Database Connectivity Toolkit.

 

Description

When writing data to a database, you may have the data in array format, with each array element corresponding to a different column of the database. This example allows to easily write array data to your database: each array element will be written to a different column in a desired database table.

 

Steps to Implement or Execute Code

  1. Select the UDL file for the connection information to the desired database. You can run this example using LabVIEW.udl connection file for the LabVIEW.mdb database provided with Database Connectivity Toolkit examples. To create a new database instead,  you may also consider DATABASE CREATION PROCEDURE.pdf available here
  2. Set the desired Table Name and Columns
  3. Write the data to insert into the Database in Array Input Data control
  4. Run the VI

 

Requirements

  • LabVIEW 2012 (or compatible)
  • Database Connectivity Toolkit 2012 (or compatible)

 

Additional Information or References

VI Block Diagram

Insert Array Data into DataBase LV 2012 NI Verified.png


**This document has been updated to meet the current required format for the NI Code Exchange.**
 
Salvador Mikel
National Instruments
Ingeniería de Aplicaciones
www.ni.com/soporte

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
parii
Member
Member
on

i do it but it shows error..no of coloumns does not equals to parameter .what does it means

ijustlovemath
Active Participant
Active Participant
on

Perhaps you should see if the number of columns you're inserting is equal to the number of parameters you're inserting.