11-02-2007 08:29 AM
11-04-2007 11:53 AM
11-05-2007 09:49 AM
11-05-2007 11:05 AM
There are a couple problems with your code:
1. The DB Insert vi requires a cluster of elements, with each cluster element corresponding to a column of the 1D array of columns wired to column. To do this, its easiest to keep your data in non-variant form, then use the "Array to Cluster" thing (make sure to right click and set the number of elements, you have to do it manually). The only time you would wire a variant to the Insert vi is when you want to insert it into a single column. Note also the DB Insert vi will only allow you to do a 1D array at a time.
2. The number of elements in the variant data is one more than the columns (you have 8 columns but 9 elements in the Variant control, by my count). In the VI attached I simply set the "Array to Cluster" to have 8 elements, so it should work.
Why they require you to put the data in cluster format has been discussed here:
http://forums.ni.com/ni/board/message?board.id=170&thread.id=133738&view=by_date_ascending&page=3
Basically some people from the old SQL toolkit wanted it that way, probably to prevent broken code. Personally I think it should be changed, or the "array to cluster" should allow programmatic setting of element size.
11-05-2007 12:15 PM