Hi all,
I have been trying to save a record with 2 of the fields being uniqueidentifier on MSSQL.
The error I have been getting is
the data comes out of a MAP
The full sub is
Have tried to change it to Object instead of string but still the same issue
I have been trying to save a record with 2 of the fields being uniqueidentifier on MSSQL.
The error I have been getting is
com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting from a character string to uniqueidentifier.
the data comes out of a MAP
B4X:
paramsInfo(0) =info.Get("masteritem")
The full sub is
B4X:
Sub saveiteminfo(sql As SQL,info As Map)
Dim querySaveInfo As String = utils.prepareInsertQuery($"
INSERT INTO assets (
[id]
,[customer_id]
,[insurance_company_id]
,[item_name]
,[item_description]
,[item_cost]
,[policy_number]
,[serial_number]
,[claim_number]
,[brand]
,[extra_info]
)
"$)
Dim paramsInfo(querySaveInfo.Length - querySaveInfo.Replace("?","").Length) As String
paramsInfo(0) =info.Get("masteritem")
paramsInfo(1) =info.Get("user_id")
paramsInfo(2) =info.Get("insurancecomany")
paramsInfo(3) =info.Get("model")
paramsInfo(4) =info.Get("description")
paramsInfo(5) =0
paramsInfo(6) =info.Get("policynumber")
paramsInfo(7) =info.Get("serial")
paramsInfo(8) =""
paramsInfo(9) =info.Get("brand")
paramsInfo(10) =""
sql.ExecNonQuery2(querySaveInfo,paramsInfo)
sql.close
End Sub
Have tried to change it to Object instead of string but still the same issue