11-17-2014 10:40 PM
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
11-17-2014 11:05 PM - edited 11-17-2014 11:07 PM
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.
11-17-2014 11:21 PM
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
11-18-2014 12:08 AM
http://www.w3schools.com/sql/default.asp
Checkout this link, it will give you basic knowledge of SQL.
11-18-2014 01:28 AM
@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.
11-18-2014 01:30 AM - edited 11-18-2014 01:36 AM
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
11-18-2014 02:32 AM
Thanks Miraz...this link is very helful for me for learning SQL.
11-18-2014 10:11 PM
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.
11-18-2014 11:09 PM
@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.
11-18-2014 11:40 PM
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