I having trouble with ExecuteMemoryTable

drj

Member
Licensed User
Longtime User
Hi,

I am trying to use ExecuteMemoryTable and its giving me an error. Here is the code and error. I am using the same logic you sent me before. Does it mean there is nothing in the database or have I interpreted ExecuteMemory wrong. The table functions has one row but many columns.

Dim DbList As List
Query = "select * FROM functions WHERE rowid=?"
DbList = DBUtils.ExecuteMemoryTable(SQL1,Query,Null,0)
Dim values() As String
values = DbList.Get(0)
Log(values(0))


Error I am getting?
main_prepare2 (B4A line: 368)
values = DbList.Get(0) this line it stops and errors?
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
 

stevel05

Expert
Licensed User
Longtime User
You've told it there is an argument with 'WHERE rowid=?', then passed null as the argument which will be ignored. If you want to search for null fields passing Array As String(Null) should do it.
 
Upvote 0

drj

Member
Licensed User
Longtime User
Thanks that worked , I can read the data Yeah

Hi Steve,

Thanks it works great now.

Jerry
 
Upvote 0
Top