what are the different between these two when handling large Sqlite database
01.
B4X:
Cursor1 = SQL1.ExecQuery("Select * from Invoice" )
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
Cursor2.SQL1.ExecQuery("Select * from Product where ProductID= " & Cursor1.GetString("ProductID"))
Cursor2.Position = 0
Cursor3 = SQL1.ExecQuery("Select * from PDARetailer where RetID = " & Cursor1.GetString("RetailerID") )
Cursor3.Position = 0
AddRow(Array As String(Cursor1.GetString("InvoiceID") , Cursor2.GetString("ProductName"), Cursor2.GetString("RetailerName")))
Next
End If
Cursor1.Close
Cursor2.Close
Cursor3.Close
02.
B4X:
Cursor1 = SQL1.ExecQuery("Select * from Invoice" )
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
Cursor2.SQL1.ExecQuery("Select * from Product where ProductID= " & Cursor1.GetString("ProductID"))
Cursor2.Position = 0
Cursor3 = SQL1.ExecQuery("Select * from PDARetailer where RetID = " & Cursor1.GetString("RetailerID") )
Cursor3.Position = 0
AddRow(Array As String(Cursor1.GetString("InvoiceID") , Cursor2.GetString("ProductName"), Cursor2.GetString("RetailerName")))
Cursor2.Close
Cursor3.Close
Next
End If
Cursor1.Close
Cursor1 = SQL1.ExecQuery("Select i.InvoiceID,p.ProductName from Invoice as i join Product as p on i.ProductID=p.ProductID join PDARetailer as pda on i.RetailerID=pda.RetID" )
For i = 0 To Cursor1.RowCount - 1
AddRow(Array As String(Cursor1.GetString("InvoiceID") , Cursor2.GetString("ProductName"),
Next
not sure why you need the pda table tho, you don't seem to use any value of it.
Cursor1 = SQL1.ExecQuery("Select i.InvoiceID,p.ProductName from Invoice as i join Product as p on i.ProductID=p.ProductID join PDARetailer as pda on i.RetailerID=pda.RetID" )
For i = 0 To Cursor1.RowCount - 1
AddRow(Array As String(Cursor1.GetString("InvoiceID") , Cursor2.GetString("ProductName"),
Next
not sure why you need the pda table tho, you don't seem to use any value of it.