LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Execute Query returns incomplete Dataset

Solved!
Go to solution

I am currently facing an issue where my code is returning an incomplete result from the executed SELECT statement.

Only the first and last column is successfully returned while the columns inbetween are empty. 

When trying out the SELECT Statement in SQL Server Management Studio I get the complete data.

Tuluc_0-1635161677669.png

The Labview results on the other hand are imcomplete.

Tuluc_1-1635161762082.png

 

I was able to resolve this issue by changing the Cursor type at the "Execute Query" node to "dynamic". However, doing so resulted in a significant drop in performance which is why a new solution is needed.

0 Kudos
Message 1 of 6
(3,942 Views)

What's the data format of these columns?

 

Perhaps they are defined a unicode strings, don't know how LabVIEW handles these.

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 2 of 6
(3,937 Views)

Are all columns the same data type? Was your SQL query just "SELECT * from [table]" ?

 

You could try using "DB Tools Select Data.vi" as well. As a workaround and a troubleshooting step too.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 6
(3,932 Views)

Except for the first column all columns have varchar as their datatype

0 Kudos
Message 4 of 6
(3,925 Views)
Solution
Accepted by topic author Tuluc

@Tuluc wrote:

Except for the first column all columns have varchar as their datatype


 

Did you use varchar<max>? Oddly enough it does not work with LabVIEW. At least in my case I get a bunch of spaces, the number of them equal to the number of characters in each varchar<max> record.

 

What do you get if you use Select Data.vi instead?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 5 of 6
(3,865 Views)

Did you use varchar<max>? Oddly enough it does not work with LabVIEW. At least in my case I get a bunch of spaces, the number of them equal to the number of characters in each varchar<max> record.

 

What do you get if you use Select Data.vi instead?


Yes, this seems to have been the problem. After limiting the datatypes the code now returns all results. 

 

Thanks a lot!

0 Kudos
Message 6 of 6
(3,812 Views)