I am trying to call a SQLServer
stored Scalar function through Apache Common DbUtils
.
I tried something like this:
run.query("SELECT [MyDB].[dbo].[test] ('testParam')", new ScalarHandler());
But, I get this exception:
com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException: Unable to identify the table SELECT [MyDB].[dbo].[test] ('testParam') for the metadata.
While, running the same query in the SQLServer returns a valid Scalar value.
I am wondering how can I call a Scalar function using Apache DbUtils.
UPDATE: For Table-valued functions it works if I ues "SELECT * FROM
..."