Just started with SQLlite and B4J and I have problems getting the hang of it. If I understand things right you can't use ordinary SQL commands like 'SQLExecute' ?
I'm starting building sub's for searching,inserting data etc but problems. From error I expect 'ExecuteMemoryTable' want's a string from array ???. What is the correct way to call 'ExecuteMemoryTable' with arguments?.See code snippet below. Any help to get further appreciated
If I pass arguments with 'NULL' it compiles ok
mlist=DBUtils.ExecuteMemoryTable(sql1,"SELECT * FROM switches WHERE Name = TEST" ,Null,0)
ERROR OUTPUT ON COMPILE
B4J Version: 5.80
Parsing code. (0.03s)
Compiling code. Error
Error compiling program.
Error description: Cannot cast type: {Type=String,Rank=0, RemoteObject=True} to: {Type=String,Rank=1, RemoteObject=True}
Error occurred on line: 368
mlist=DBUtils.ExecuteMemoryTable(sql1,"SELECT * FROM switches WHERE Name =?" ,tmpDevice,0)
Word: tmpdevice
Regards Håkan
I'm starting building sub's for searching,inserting data etc but problems. From error I expect 'ExecuteMemoryTable' want's a string from array ???. What is the correct way to call 'ExecuteMemoryTable' with arguments?.See code snippet below. Any help to get further appreciated
B4X:
#AdditionalJar: sqlite-jdbc-3.7.2
Sub Process_Globals
.
.
.
Private sql1 As SQL
End Sub
Sub AppStart (Form1 As Form, Args() As String)
.
.
.
.
.
'open DB
Try
sql1.InitializeSQLite(File.DirApp,"data/rflink_data.db", False)
Log("Database open")
Catch
Log("Unable to open database")
End Try
Find_device("TEST")' JUST FOR TEST !!!!!!
End Sub
Sub Find_device(tmpDevice As String)
Dim mlist As List
mlist.Initialize
mlist=DBUtils.ExecuteMemoryTable(sql1,"SELECT * FROM switches WHERE Name =?" ,tmpDevice,0)
Log("mlist" & mlist)
End Sub
If I pass arguments with 'NULL' it compiles ok
mlist=DBUtils.ExecuteMemoryTable(sql1,"SELECT * FROM switches WHERE Name = TEST" ,Null,0)
ERROR OUTPUT ON COMPILE
B4J Version: 5.80
Parsing code. (0.03s)
Compiling code. Error
Error compiling program.
Error description: Cannot cast type: {Type=String,Rank=0, RemoteObject=True} to: {Type=String,Rank=1, RemoteObject=True}
Error occurred on line: 368
mlist=DBUtils.ExecuteMemoryTable(sql1,"SELECT * FROM switches WHERE Name =?" ,tmpDevice,0)
Word: tmpdevice
Regards Håkan