Android Question ExecQuerySingleResult2 different in B4A / B4i

Cadenzo

Active Member
Licensed User
Longtime User
B4X:
Dim obj As String = SQL1.ExecQuerySingleResult2(query, args)
args should be an string-array in B4A, but an list in B4i. Is there a way, to handle it on both the same? (Object-array is not working)
 

Cadenzo

Active Member
Licensed User
Longtime User
Here is, what I am doing now:

B4X:
Dim iKursID As Int = GetDBInt2("SELECT [ID] FROM Items WHERE [Typ] = 5 AND [Wochentag] = ? AND Zeit = ?", Array As String(wochentag, zeit))

Public Sub GetDBInt2(query As String, args() As String) As Int
    #if B4I
    Dim li As List = args
    Dim obj As String = SQL1.ExecQuerySingleResult2(query, li)
    #else
    Dim obj As String = SQL1.ExecQuerySingleResult2(query, args)
    #End If
    If obj = Null Then Return 0
    If IsNumber(obj) = False Then Return 0
    Return obj' SQL1.ExecQuerySingleResult(query)'gute Alternative
End Sub
 
Upvote 0
Top