Hi
I try to add a line into B4Xtable getting the info from another table.
My code is
If I execute a log() before I execute ExecNonQuery2, log() show my data correctly
But ExecNonQuery2 always return the error
Why? What I am doing wrong?
I try to add a line into B4Xtable getting the info from another table.
My code is
B4X:
B4XTable1.sql1.ExecNonQuery2($"INSERT INTO data VALUES( ?, ?, ?, ?, ?, ?)"$, Array As Object( ItemTable_All_Items.GetValue(0,row), _
ItemTable_All_Items.GetValue(1,row), NumberFormat2(Price1, 1, 0, 4, False), _
NumberFormat2(Quantity1, 1, 0, 2, False), ItemTable_All_Items.GetValue(2,row), _
NumberFormat2(Quantity1*Price1, 1, 0, 2, False)))
If I execute a log() before I execute ExecNonQuery2, log() show my data correctly
B4X:
Log(ItemTable_All_Items.GetValue(0,row) & " - " & ItemTable_All_Items.GetValue(1,row) & " - " & NumberFormat2(Price1, 1, 0, 4, False) & " - " & _
NumberFormat2(Quantity1, 1, 0, 2, False) & " - " & ItemTable_All_Items.GetValue(2,row) & " - " & NumberFormat2(Quantity1*Price1, 1, 0, 2, False))
But ExecNonQuery2 always return the error
java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.sqlite.SQLiteStatement android.database.sqlite.SQLiteDatabase.compileStatement(java.lang.String)' on a null object reference
Why? What I am doing wrong?
Last edited: