NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Insert data into MySQL数据插入数据库

Solved!
Go to solution

Hello,

I'm a new guy for ATE, our company got TestStand 4.1, 2011 and 2020, now I want to insert some data into mySQL, especially for 4.1, the old version, I've connected mySQL thru ODBC, but I don't know how to insert my data into database, when I right click in sequence: insert a test step-->database-->data operation, there's a "Statement Handle (number) " when click edit, it need key in something I have no any idea, I try to key in the database name or table name, the error showed: it expected number not string, when I key in the number from 0~11,  the error is invalid...So is any comments for this issue? Thanks a lot!

大家好,

我是新手,公司目前使用的teststand有4.1, 2011和2020,我想链接mySQL数据库,已经用ODBC连上了,可是不知怎么才能把Teststand的数据插入数据库,特别是老版本4.1的。在sequence中右键插入test step-->database-->data operation,编辑data operation时里面有个 "Statement Handle (number) ",怎么填都不对,字符,数字都试了,大家有没什么建议应该往这里面填什么啊?非常感谢!

0 Kudos
Message 1 of 3
(679 Views)

Hello, I got an updating today:

Above statement handle issue I've solved, because I found an example in TS folder Data Operation's statement handle was assigned by Open SQL step automatically, but I met a new issue: 

I created a table in MySQL, and listed two columns, name 'V1' and 'V2', and they could be displayed in Open Open Database, Open SQL and Data Operation steps, the problem was when ran cursor to Operation step: Error occurred: , it says: Because column name unsearchable, error -10.

 

So, my concern is the TS 4.1 could connect to MySQL, and in DATABASE step types also could display my table which was I created in MySQL, but when I want to insert data, it display can't find column name...

 

Is anyone could help me about this? Thanks a lot!

 

大家好,今天我有所进展,昨天关于句柄的事已解决,句柄来自打开数据库模块的自动赋值。但今天我又遇到了新问题:

我在数据库中建立好一个表,有2个列V1和V2,TS和MySQL可以建立链接,表在TS中可以被打开查看,在TS database Operation模块中可以选中要操作的列:V1,V2,但只要我一执行到Operation database那一步,写入就出错,说数据库找不到我定义名字的列……error: -10……

 

各位有知道的麻烦指点一下,非常感谢!

0 Kudos
Message 2 of 3
(649 Views)
Solution
Accepted by topic author Robin_Jiang

Hello all, I've done this issue, it was occurred my SQL column's definition was: Double, now I updated it to be: Decimal, everything done, it just a data type compatibility issue.

各位,我已解决此问题,问题的主要原因是我SQL设置为双精度,现在我改成十进制就好了,只是数据类型兼容性问题。

0 Kudos
Message 3 of 3
(632 Views)