LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView-DataBase Connectivity

Hi,

I have issue with writing the array data into SQL database and I am new in Labview & SQL Database. I am using NI Database connectivity toolkit to write the code into labview.

In my project I have to create the table and update the table using Labview. I  have made a program to create the table and write the array value (size 1024X10X5) into SQL database.

But I stuck here to write the array value into the table and I am able to write only single value into the table.


I have attached the VI for your reference , please review the code and let me know is there any programming error or some thing i am missing .

Also I wanted to know How much data we can write within a second into Database?

This is very urgent requirement .

 

Regards,

Srikant

0 Kudos
Message 1 of 17
(3,875 Views)

No one know how much you write on 1 sec. It depends on plenty of parameters. There is standard VI in tool kit to do what you need.

 At a time you can add one record contain all the data i.e. in one table say 3 column are there then at a time you need to write to all 3 column. 

 

Can you upload in 2011.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 17
(3,860 Views)

Hi Ranjeet,

Thanks for reply and suggestion.

Ok. means I can write the 3072000 sample within 5 mint at database.

One more thing I need to ask how to create a relationship between nos of table let say 3 table using foregin Key through Labview?

 

I have attached the 2011 version of my code.

 

 

Thanks,

Srikant Singh

0 Kudos
Message 3 of 17
(3,847 Views)

http://www.w3schools.com/sql/default.asp

 

Checkout this link, it will give you basic knowledge of SQL.

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
Message 4 of 17
(3,836 Views)

@srikant_kumar wrote:

Hi Ranjeet,

Thanks for reply and suggestion.

Ok. means I can write the 3072000 sample within 5 mint at database.

One more thing I need to ask how to create a relationship between nos of table let say 3 table using foregin Key through Labview?

 

I have attached the 2011 version of my code.

 

 

Thanks,

Srikant Singh


I am not sure. It also depends on your code and. Also if record is 307200 then in one record how many parameters are there? 

 

You can program that which col you want as foreign key while creating table only.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 17
(3,829 Views)

By seeing your VI I will suggest is whenever you open DB that when finished, close the DB. It will free the resources.

 

Why column name is empty.(there are few rules for col name. Read it)....create table Name

 

What is this--------Table and column confi

What is this VI? what you want to do? You dont need while loop..................write into sql database

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 6 of 17
(3,827 Views)

Thanks Miraz...this link is very helful for me for learning SQL.

 

 

 

0 Kudos
Message 7 of 17
(3,807 Views)

Hi Ranjeet,

Thanks for your help.

There is  main VI(write into sql table) and other two are subvie(create table name.vi and table and coulumn confi.vi). 

table and coulumn confi.vi: User can create table name and set coulumn properties.

create table name.vi: Whatever table name coulumn created by the user will update here and table will be created in sql database.

 

Now I can able to write the array value but only one to one not in one go. I wanted to write bulk size of data(3700000 sample ) in single run that should not take more than one min.

 

 

 

0 Kudos
Message 8 of 17
(3,764 Views)

@srikant_kumar wrote:

Hi Ranjeet,

Thanks for your help.

There is  main VI(write into sql table) and other two are subvie(create table name.vi and table and coulumn confi.vi). 

table and coulumn confi.vi: User can create table name and set coulumn properties.

create table name.vi: Whatever table name coulumn created by the user will update here and table will be created in sql database.

 

Now I can able to write the array value but only one to one not in one go. I wanted to write bulk size of data(3700000 sample ) in single run that should not take more than one min.

  


I dont know your application and purpose. Why table and coulumn confi.vi:, during instertion of data you can check whether table exists or not, Most user dont know the table name rules. In that case it is very difficult to manage your vi. Becasue we cant ensure all user are aware of rules.

 

At the time of insertion you can do all the job which currently done by you manually. Use for loop and inside that your DB insert recode VI. Let me know if you know example. 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 17
(3,748 Views)

Table creation i will manage only my worry is how to write bulk size of data. I am doing same now what you r explain here. Passing array into for loop with auto index enable and DB tool insert data inside the for loop. But this process is taking to much time to write into database. i wanted to write the whole setup array in one go not in one by one.

I have attached the image of latest vi for your reference. 1st image generating the data and after completion of data generation ,second image is writing the generated data SQL database.

 

Please let me know if you found any solution

Download All
0 Kudos
Message 10 of 17
(3,742 Views)