welu1805 Active Member Licensed User Longtime User Mar 7, 2017 #1 Hello, I get the error: SQLiteException: unknown error (code0) INTEGER data in nativeGetBlob Code: Copy Dim curs As Cursor curs = Main.dbSQL.ExecQuery("SELECT * FROM sortedtexts WHERE PK=" & Main.TextPK) curs.Position = 0 Dim blobBuffer() As Byte blobBuffer = curs.GetBlob("Blobres") The field "Blobres" is empty. Does anyone know what is the problem? Thanks Lutz
Hello, I get the error: SQLiteException: unknown error (code0) INTEGER data in nativeGetBlob Code: Copy Dim curs As Cursor curs = Main.dbSQL.ExecQuery("SELECT * FROM sortedtexts WHERE PK=" & Main.TextPK) curs.Position = 0 Dim blobBuffer() As Byte blobBuffer = curs.GetBlob("Blobres") The field "Blobres" is empty. Does anyone know what is the problem? Thanks Lutz
Erel B4X founder Staff member Licensed User Longtime User Mar 8, 2017 #2 1. You should move dbSQL to the starter service and initialize it there. 2. You should use parameterized queries. Code: Copy Dim curs As Cursor = Starter.dbSQL.ExecQuery2("SELECT * FROM sotedtexts WHERE pk = ?", Array As String(Main.TextPK)) About the error, what is the output of Log(curs.GetString("Blobres")) ? Upvote 0
1. You should move dbSQL to the starter service and initialize it there. 2. You should use parameterized queries. Code: Copy Dim curs As Cursor = Starter.dbSQL.ExecQuery2("SELECT * FROM sotedtexts WHERE pk = ?", Array As String(Main.TextPK)) About the error, what is the output of Log(curs.GetString("Blobres")) ?
welu1805 Active Member Licensed User Longtime User Mar 8, 2017 #3 Hi Erel, sorry, but I changed my code for inserting a new record to a parameterized query nad had a wrong number of parameters, so in the blob field was an integer value stored. I fixed this and now it works as expected. Thank you. Upvote 0
Hi Erel, sorry, but I changed my code for inserting a new record to a parameterized query nad had a wrong number of parameters, so in the blob field was an integer value stored. I fixed this and now it works as expected. Thank you.