Android Question jRDC2, MSSQL, StoredProcedure and Output Direction

h725

Active Member
Licensed User
Longtime User
Hello everybody,

I have the following combination:
B4A with jRDC2
MSSQL Server as Database Server

I am working with stored procedures on the MSSQL Server. These are working
with jRDC2 with no problems. But now I would like to realize to get an output parameter
of the stored procedure. (Which is the primary key of the inserted row.)

In the stored procedure the output parameter looks like this:
B4X:
@maxid INT OUTPUT

SET @maxid  = SCOPE_IDENTITY()

In VB.net I can work with the output parameter like this:

B4X:
sqlComm.Parameters.AddWithValue("@maxid", SqlDbType.Int)
sqlComm.Parameters("@maxid").Direction = ParameterDirection.Output

Dim maxid As Integer = CInt(sqlComm.Parameters("@maxid").Value.ToString())

How can I realize working with the output direction in B4A/jRDC2?

Thank you very much in advance.
 
Top