Hi There
I have been looking at this code for a long long time and I can't seem to identify the issue here. The following code gives me an error:
As you can see I was using ExecuteQuery and I got this error from the server:
After changing to ExecuteCommand I get this error:
config.properties file:
Officers_Table, OfficerIDNo and record with OfficerIDNo = 222 all exist in the database.
Please help me
I have been looking at this code for a long long time and I can't seem to identify the issue here. The following code gives me an error:
B4X:
Public Sub Delete_Officer_From_DB(delOfficerIDNo As Int)
delOfficerIDNo = 222
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("Delete_Officer", Array(delOfficerIDNo))
' Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
Wait For (req.ExecuteCommand(cmd, Null)) JobDone(j As HttpJob)
If j.Success Then
Log("Officer deleted from DB successfully!")
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
End Sub
As you can see I was using ExecuteQuery and I got this error from the server:
B4X:
(SQLException) java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
Command: , took: 8ms, client=105.209.231.27
After changing to ExecuteCommand I get this error:
B4X:
(SQLException) java.sql.SQLException: No value specified for parameter 2
(EofException) org.eclipse.jetty.io.EofException: Closed
Command: , took: 7ms, client=105.209.231.27
config.properties file:
B4X:
sql.Delete_Officer= DELETE FROM Officers_Table WHERE OfficerIDNo = ?
Officers_Table, OfficerIDNo and record with OfficerIDNo = 222 all exist in the database.
Please help me