Skip to Content
0
Former Member
Nov 15, 2012 at 10:29 AM

Using parameters from Java to access SAP Hana via procedures

34 Views

Hi,

i have a problem when accesing a procedure with an OUT parameter from java.

If I use a procedure without parameters, there is no problem:

ResultSEt rs = stmt.executeQuery("CALL \"HD9240\".\"test1/bookings\"");

but if I call a procedure with an output parameter, the ResultSet is null

rs = stmt.executeQuery("call \"HD9240\".\"TEST_NUMBER_CUSTOMERS2\"(?)");

The procedure is working in Hana Studio and it is defined as follows:

CREATE PROCEDURE TEST_NUMBER_CUSTOMERS2( OUT numeroClientes INTEGER) language sqlscript AS
BEGIN select
count(*)
into numeroClientes
from "HD9240"."SCUSTOM"
;

END
;


How do you pass parameters in and out from Java to Hana?

regards,
MIguel