12-20-2018 01:49 AM
Hi Guys
I am making a test to insert some data into Mysql but comes a error(see the attached),where is wrong with the code?
Can someone give a hand please.
Solved! Go to Solution.
12-20-2018 02:46 AM
You can't insert many rows by this way (You are trying to add just one item instead of many rows.).
1st way: thy C:\Program Files (x86)\National Instruments\LabVIEW XXX\examples\database\Database Logging (parameterized).vi
2nd way: build SQL request
12-20-2018 03:42 AM
Thanks for the reply,do you have an example because i am know with labview.
12-20-2018 07:06 AM
12-20-2018 08:15 AM
Hi
I used your sample but still got error,i do not know what to try now
12-20-2018 08:37 AM
First, you should "try" to practice attentiveness, because you did NOT try my example, but something of your own.
INSERT INTO table_name (col1, col2, col3, col4)
VALUES ('111', '2222', '3333', '4444') ('55', '6', '7', '8') ('12', '11', '10', '9 '))
This is NOT a valid SQL query and this is NOT what I sent.
Secondly, you should try to learn SQL syntax, then half the questions will disappear.
Here is what I sent as an example.
INSERT INTO table_name (col1, col2, col3, col4) VALUES ('111', '2222', '3333', '4444'), ('55', '6', '7', '8'), ('12', '11', '10', '9');
12-20-2018 06:51 PM
Now it works like that,thanks for help.
06-26-2020 12:33 AM
Hi Sir,
Seems you are familiar with the database operation of labview.
Hence i have a question beyond this topic, could i use the udl to connect to local mysql server ?
If yes, what provider should i choose ?
Thanks.
06-27-2020 08:53 AM
@Brzhou123 wrote:
could i use the udl to connect to local mysql server ?
If yes, what provider should i choose ?
yes, and how to configure udl you can read here
06-27-2020 10:38 AM
Hi Sir,
Thanks for the details.
I think the key point is the connection string:
Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Port=3306;Database=myDataBase;
User=myUsername;Password=myPassword;Option=3;
So prior to do this setting, i need to install the mysql odbc 5.1, then in the provider page, i choose it ?