JDBC.NET icon indicating copy to clipboard operation
JDBC.NET copied to clipboard

Issue with getting output parameters values on procedure calls

Open SlokarF opened this issue 1 year ago • 0 comments

Good day,

i have an issue calling procedure and getting output parameters from it, procedure call seemingly executes but the output parameters values are not filled. there is my example code:

 await using var jdbcCommand = executionContext.Connection.CreateCommand("{ CALL TEST_SUM_DIFF(?,?,?,?)}");
 
 jdbcCommand.Parameters.Add(new JdbcParameter{ Direction = ParameterDirection.Input, ParameterName = "XY", DbType = DbType.Int32, Value = 3 });
 jdbcCommand.Parameters.Add(new JdbcParameter{ Direction = ParameterDirection.Input, ParameterName = "YX", DbType = DbType.Int32, Value = 2 });
 jdbcCommand.Parameters.Add(new JdbcParameter{ Direction = ParameterDirection.Output, ParameterName = "SUM_X_Y", DbType = DbType.Int32, Value = 0});
 jdbcCommand.Parameters.Add(new JdbcParameter{ Direction = ParameterDirection.Output, ParameterName = "DIFF_X_Y", DbType = DbType.Int32, Value = 0 });
 
 jdbcCommand.ExecuteNonQuery();

 var outParam1 = jdbcCommand.Parameters["SUM_X_Y"].Value.ToString();
 var outParam2 = jdbcCommand.Parameters["DIFF_X_Y"].Value.ToString();

Connection works, the call works, but the output is not given out, is there something I am doing wrong or is this a bug? If i am doing something wrong can I get corrected code?

SlokarF avatar Dec 19 '24 11:12 SlokarF