Hello,
I have a a stored function on mssql which works ok when tested from SSMS.
Calling it from a cuba service modul (shown below) causes the error:
‘Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.14-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.’
I tried hard for two days, hours and hours of crawling the web…any modifications on the call causes syntax problems. Don’t see what’s going wrong.
Does anyone have an idea?
Thanks a lot!
Willi
the SP:
CREATE OR ALTER FUNCTION [dbo].[fn_getInterestCalculation]
(
@p_dDateRef date,
@p_DateFrom date,
@p_DateTo date,
@p_Amount decimal(12,2),
@p_RateHike decimal(12,2)
)
RETURNS decimal(12,2)
AS
BEGIN
DECLARE @InterestAmount decimal(12,2) -- RetVal
:
:
:
-- some DB - access & logics
:
:
:
:
-- Return the result of the function
RETURN @InterestAmount
END
I work with postrgresDB and do not use stored procedures. So I can only send you my ideas how to come around the problem
a) reduce the problem: Try to call a procedures without any parameters that does nothing than logging. If that works, get complexer
b) check DB logs
c) check user access rights (grand all to the user)
d) debug into the JDBC Implementation
@willi
For SQL Server database, I use stored procedure within which functions are called. I’m not sure if we can use SQL server functions from CUBA platform but sure that we can use Stored Procedure.
Hi Mortoza, thanks for the hint. I’m just on the way with that.
Gettting some inspirations on @Mike’s (thanks) thoughts.
Meanwhile, for testing puproses, I inserted the results to a DB-Table (only possible from a procedure),
so the proc internals are ok. It’s all about getting the results back.