B4J Question SQL stored procedure with 1 parameter

LucianoB

Member
Licensed User
Longtime User
Good day,
I have a MSSQL Server and I created a stored procedure which is executed from another program (in VB.NET) and receives one parameter from the same program. Now I want to call the same stored procedure from B4J, sending that parameter as well. I used the following code but it gives me an error: "java.sql.SQLException: The executeQuery method must return a result set."

B4X:
    Dim cs As Object = sql1.CreateCallStatement("{call uspAssignNewNumber(?)}", Array(RemarkData.Get(0)))
Dim rs As ResultSet = sql1.ExecCall(cs)

What am I doing wrong?
Thank you
 

LucianoB

Member
Licensed User
Longtime User
Well, I found a solution for the above issue.
I wrote this code to execute my parametrized stored procedure. Maybe it's a small issue but for me is a little more step learning how to connect B4J to MS SQL.

B4X:
Dim str2 As String = "EXEC uspAssignNewNumber @acserial = " & RemarkData.Get(0)
sql1.ExecNonQuery(str2)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…