Get returning value from a stored procedure in C# : CSharp « Procedure Function « SQL / MySQL






Get returning value from a stored procedure in C#

 


CallableStatement PreparedFunc = MyConnect.prepareCall("{ ? = call isodd( ? ) }");
PreparedFunc.registerOutParameter(1, Types.INTEGER);

PreparedFunc.setInt(1, aNumber);
PreparedFunc.execute();

if (PreparedFunc.getInt(1) == 1)
     System.out.println(aNumber + " is odd");
else
     System.out.println(aNumber + " is even");



        








Related examples in the same category

1.Calling a stored procedured in C#