How to call a SQL Server stored procedure with new DB nodes?

Hello,

is there any possibility to get the result of a stored procedure from a SQL Server through the new db nodes? I read through older postings, but could not find anything that solved my problem.
Nevertheless it works with the legacy Database Reader node with the option checked “Run SQL query only during execute, skips configure”.

I am trying this on SQL Server 2014 which works fine in SQL Server Management Studio:

EXEC	[BSRPPDBSVPDWH_USER].[dbo].[procReportPace]
		@Start = N'2021-04-07',
		@End = N'2021-04-07',
		@Time = 6

I am getting the following error: Incorrect syntax near the keyword ‘EXEC’

Thank you and kind regards,
Florian

I tried to rebuild with the new DB framework what @tobias.koetter suggested in this post for the legacy framework: Call Stored Procedure, Read Workflow Credentials in Java Snippet - #5 by tobias.koetter

This worked just fine for me:

In DB SQL Executor I create the procedure (might not be needed in your case):

DROP PROCEDURE simpleproc;
CREATE PROCEDURE simpleproc
AS
	SELECT count(*)
	FROM knimeTest; 

and with DB Query Reader I execute the procedure and retrieve the result set:
EXEC simpleproc

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.