Is there a way to run stored procedures with table-valued input parameters from Matlab using the Database Toolbox?
3 次查看(过去 30 天)
显示 更早的评论
I'm currently trying to run a Stored Procedure written in SQL Server from Matlab. My problem is that I have several inputs, some of them having variable number of parameters (for example one is a table containing 3 columns and at every run different number of rows).
Running the runstoredprocedure function will not work because it only accepts values and not matrices, something like datainsert will not work either, because I have to populate a not yet existing table (type), and finally I tried to run it using the exec function, but for some reason that does not give back any result set, which is a problem also.
sqlquery1 = 'DECLARE @input TVP; DECLARE @output int;';
sqlquery2 = ['INSERT INTO @input VALUES (' val1 ',' val2 ',' val3 ');'];
sqlquery3 = 'exec dbo.sp_Name @input, @output OUTPUT;';
curs = exec(conn,[sqlquery1 sqlquery2 sqlquery3])
Running a code like this I only get the Message 'The statement did not return a result set.'
Is there a way to call something like this from Matlab? Any help would be appreciated.
Thanks.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!