on 11-15-2012 10:29 AM
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
Hi,
You can use parameters as I wrote below:
PreparedStatement stmt = conn.prepareStatement("call \"HD9240\".\"TEST_NUMBER_CUSTOMERS2\"(?)");
stmt.setString(1, yourParam);
stmt.execute();
stmt.close();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.