05-30-2024 04:18 AM
In Labview I want to execute SQL code:
declare @mylist TableOfInvSt;
insert into @mylist values ('a'),('b'),('c')
EXEC get_data @mylist
Till today I used stored procedure with procedure values defined in labview only. Code Attached
Solved! Go to Solution.
06-03-2024 04:27 AM
I got my solution. If anybody knows better way to do the same thing, please share it.
06-03-2024 05:47 AM
2 small anti-Rubes come to mind, there's a DB Tools Get Columns in the DB utils group and you get remove the final nested loop and convert directly to a 2D string array.
06-03-2024 08:35 AM
@Yamaeda wrote:
and convert directly to a 2D string array.
That's tricky though.
It will only work if all elements are strings. If one element is void, the entire conversion fails.
SQL Queries on Excel do that (return void in stead of "" for some (empty?) elements).
06-03-2024 08:38 AM
wiebe@CARYA wrote:
SQL Queries on Excel do that (return void in stead of "" for some (empty?) elements).
Really? I've not played with SQL Excel 🙂
06-03-2024 09:34 AM - edited 06-03-2024 09:38 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
SQL Queries on Excel do that (return void in stead of "" for some (empty?) elements).
Really? I've not played with SQL Excel 🙂
I don't really recommend it. Apparently the 'database' driver uses DDE to loop over cells pretty much like a user would... But it distributes more reliable than the RGT (which doesn't mean much 😋).
You can (or could, it's been a while) even open a connection string to a txt file.
EDIT Something like this (not tested):
Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\txtFilesFolder\;Extensions=asc,csv,tab,txt;
Data Source='C:\MyFolder';Delimiter=',';Has Quotes=True;Skip Rows=0;Has Header=True;
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;Extended Properties="text; HDR=Yes; FMT=Delimited";