B4J Question B4J jRDC2 - MS SQL Server Stored Procedure AND array variable

h725

Active Member
Licensed User
Longtime User
Hello everybody,

My configration:
Serverside:
MS SQL Server
MS SQL Management Studio
jRDC2

Clientside:
B4A Application

I have a stored procedure which is working fine.
I need to work with stored procedure due to security reasons in a booking
process.

Now I would like to pass an integer array to this stored procedure as a variable.
I checked the web and there are several topics, but nothing fits yet.
SQL Server 2008 supports userdefined types which are declared as tables -
in VB you can access these types with the datatable object. But in B4A this does not
exist.

Maybe there is somebody outside who had to deal with the same problem.
In detail I need to update those rows in my orders table, which have the id value from
the paramaters array.

Thank you very much in advance.

h725
 

keirS

Well-Known Member
Licensed User
Longtime User
I think you are referring to table valued parameters. In which case the SQL Server JDBC drivers supports them. So you could alter JRDC2 to support them and use JavaObject to create a SQLServerDataTable.

The other option (possibly simpler) is to pass a comma separated string ( eg. "34566,344531,3455678") to your stored procedure and then split the string in the stored procedure.
 
Upvote 0

h725

Active Member
Licensed User
Longtime User
Hello keirS,

thank you for the response. Due to simplicity I tried the second way and it is working fine so far.

Thank you very much
h725
 
Upvote 0
Top