取消
显示结果 
搜索替代 
您的意思是: 

Execute Stored Procedure with declared variable

已解决!
转到解答

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

0 项奖励
1 条消息(共 6 条)
1,277 次查看
解答
已被主题作者 mitjaAl 接受

 I got my solution. If anybody knows better way to do the same thing, please share it.

snip.png

0 项奖励
2 条消息(共 6 条)
1,204 次查看

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
3 条消息(共 6 条)
1,190 次查看

@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).

0 项奖励
4 条消息(共 6 条)
1,173 次查看

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 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 项奖励
5 条消息(共 6 条)
1,170 次查看

@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";
6 条消息(共 6 条)
1,159 次查看