B4J Question [SOLVED] JRDC2 MSSQL procedure return table

makis_best

Well-Known Member
Licensed User
Longtime User
Hi.

I have these scenario I try to solve.
B4A client.
B4J as JRDC2 server
MsSQL database.

On MsSQL Server database I have a procedure called Scalc1 and get two variables Date1 and TheGidIn.
The result of Scalc1 is a table.

The questions are...
What I need to write on config.properties so I can use the Scalc1 procedure?
What code I need to write on B4A so I can execute the procedure and pass the variables with the array?

Thank you.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Jrdc2 is not planned for procedure calling. You could adjust it tho.

Read about procedures here:

You could use that library or overall implement its functionality in Jrdc2
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
The result of Scalc1 is a table
Please note that exec query can actually call simple stored procedures that return a result set (a table). No special magic needed.
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
@OliverA I understand that is not a magic.
My problem is how from B4A I will pass the parameters to JRDC2 and get back my record set.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
My problem is how from B4A I will pass the parameters to JRDC2 and get back my record set.
The same as a regular query, via ? So, for example, let's say you have a stored procedure called sLogin that has username and password as parameters, then in config.properties set up
B4X:
sql.sLogin=CALL sLogin(?,?)
and in your code something like:
B4X:
Dim cmd As DBCommand = CreateCommand("sLogin", Array("John", "password"))
And process it via ExecuteQuery like you would any other query that you do via DBRequestManager
 
Upvote 0
Top