LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help for "From concatenate string insert to mysql table"

i nid to insert values from concatenate string into mysql with using LabSQL, but the result come out from conatenate string is like " 2015-07-08 00:00:00 38.933235E-3" , a logged data of "Date Time Wind Speed(m/s). i nid to put these 3 values into 3 different column in mysql which is Date Time and Wind Speed. How can i pick Date to put inside Date's column, Time into Time's column and Wind Speed into Wind Speed's column in mysql ?

 

What i do is
INSERT INTO wind_speed_data (Date, Time, Wind_Speed) The space in Wind Speed can i put a _ in between Wind Speed? without _ and just put Wind Speed it shows errors.

VALUES( i have no idea wat to key in at this part ) <--- nid help !

 

The Mysql table. Date Time Wind Speed

New Picture (8).PNG

 

The result from concatenate string. Have to insert into mysql.

New Picture11.PNG

 

My labview program.

New Picture (7).PNG

 

The error i facing.

New Picture (4).PNG

 

0 Kudos
Message 1 of 27
(4,390 Views)
Why are you still using the wrong syntax with value1, value2, etc. when you were answered at http://forums.ni.com/t5/LabVIEW/Someone-can-help-me-please/td-p/3145791/page/2 with the correct way to use the format string.
0 Kudos
Message 2 of 27
(4,348 Views)
Well, most of this problem is a question about SQL syntax. In the VALUES clause you put a comma delimited list of the values to go into the new record. You insert one record at a time. How are the columns defined? Have you done any study on basic SQL?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 27
(4,339 Views)

Hi dear dennis, I did try what dkfire taught me. i try my program as below pic.

 

 

New Picture (5aa).bmp

 

and i got this error...

New Picture (10).JPG

 

 

 

 

0 Kudos
Message 4 of 27
(4,313 Views)

First off, the syntax is wrong. You need to use a single quote (') not the character you used (`). Second, how are the columns defined?

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 27
(4,291 Views)

hi mike, thanks for ur reply. appreciate it !. The columns defines do u means the 3 columns created in mysql ? the datetype of the columns ?

Date format Datetime, Time format timestamp, Wind Speed format decimal(10,10). all 3 are not nullable.

0 Kudos
Message 6 of 27
(4,280 Views)

@Jxwong2203 wrote:

hi mike, thanks for ur reply. appreciate it !. The columns defines do u means the 3 columns created in mysql ? the datetype of the columns ?

Date format Datetime, Time format timestamp, Wind Speed format decimal(10,10). all 3 are not nullable.


Just a random, drive-by, comment here...  I've had trouble with column names before and "Date" and "Time" look like they might be reserved words in a DBMS.  Also, in Access anyway, if a column name has spaces you need to enclose it in brackets, so "[Wind Speed]", not "Wind_Speed".

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 27
(4,186 Views)

Hi jim, thanks for your advise !!

0 Kudos
Message 8 of 27
(4,177 Views)

Jim is correct, Date and Time needs [] around them. 

 

Then why (the f..) are are you giving the same data to ALL you controls? 

0 Kudos
Message 9 of 27
(4,149 Views)

hi dkfire , i did 4lo your advise to connect up. 

 

DKFIRE.png

 

Connected as below. One question, do i nid to connect the output of concatenate string to the initial string of format into string ? Because i get my data from concatenate string.

sf.JPG

 

 

I have no idea how to put the data from concatenate string into my control of Date, Time, Wind Speed. because my these 3 values get it from concatenate string.

ssssss.JPGi got no values in my control of Date, Time, Wind Speed. =.=

New Picture (s6).JPG

0 Kudos
Message 10 of 27
(4,084 Views)