gerardguerin Member Licensed User Longtime User Nov 6, 2014 #1 HI, Somebody have a working sample of sending a Sqlite field blob with DBRequestManager, I can send and receive all type but not blob :-( My code look like that: B4X: dim BlobBuffer() as byte Cursor1.Position = 1 ref_id= Cursor1.GetString("ref_id") BlobBuffer = Cursor1.GetBlob("PDFdata") Dim cmd As DBCommand cmd.Initialize cmd.Name = "save_blob" cmd.Parameters = Array As Object(ref_id,BlobBuffer) reqManager.ExecuteCommand(cmd,"save_blob") Thank in advance
HI, Somebody have a working sample of sending a Sqlite field blob with DBRequestManager, I can send and receive all type but not blob :-( My code look like that: B4X: dim BlobBuffer() as byte Cursor1.Position = 1 ref_id= Cursor1.GetString("ref_id") BlobBuffer = Cursor1.GetBlob("PDFdata") Dim cmd As DBCommand cmd.Initialize cmd.Name = "save_blob" cmd.Parameters = Array As Object(ref_id,BlobBuffer) reqManager.ExecuteCommand(cmd,"save_blob") Thank in advance
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2014 #2 How is save_blob defined in the config file? Upvote 0
gerardguerin Member Licensed User Longtime User Nov 7, 2014 #3 Yes but the server respond : com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'PDFdata' at row 1 The coluum have the same name local and remote, the PDF file in the table have 663kb Upvote 0
Yes but the server respond : com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'PDFdata' at row 1 The coluum have the same name local and remote, the PDF file in the table have 663kb
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2014 #4 Assuming that you are using MySQL then the solution is described here: http://stackoverflow.com/questions/21522875/data-truncation-data-too-long-for-column-logo-at-row-1 You need to use MEDIUMBLOB or LONGBLOB. Upvote 0
Assuming that you are using MySQL then the solution is described here: http://stackoverflow.com/questions/21522875/data-truncation-data-too-long-for-column-logo-at-row-1 You need to use MEDIUMBLOB or LONGBLOB.
gerardguerin Member Licensed User Longtime User Nov 7, 2014 #5 You absolutely right, I just change the field type to BLOB to LONGBLOB and it work thank a lot Upvote 0