How Call a Stored Procedure in SQL Query on Report

Hello, i cant call a stored procedure from my sql query on report designer. I watch online video, but i need something diferent.

i Have a SP in SQL Server:

USE [FM_HBW]
GO

DECLARE @return_value int

EXEC @return_value = [dbo].[Prueba]

SELECT ‘Return Value’ = @return_value

GO

but i don´t know how call in ignition report designer

I try with this form:
call = system.db.createSProcCall(“Prueba”)
system.db.execSProcCall(call)

but don´t work.
Thanks for us help

Hi Marco,

After you execute the stored procedure you get the results by calling call.getResultSet(). Here is an example:

call = system.db.createSProcCall("Prueba") system.db.execSProcCall(call) results = call.getResultSet() table = event.source.parent.getComponent("Table") table.data = resultsThe example above gets the result from the stored procedure and sets the data in a table that is in a window.

Best,