HiI am using sqLite3 on an embedded system (STM32H743VI) using, freeRTOS,
fatFS and an SD Card using the HAL Drivers and the SDMMC1 interface.The
database works fine with doubles, integers and chars, but as soon as I
attempt to insert a record with a bound text field the step function fails
with an IO Error Short Read.The VFS I am using I developed myself from the
demo on the sqLite website.  I suspect there may be problems with this code
as it was built with very little knowledge of the internals of sqLite.I
create the databases using sqLite Studio to avoid having to write code to
produce the data bases using the embedded system. I copy the databases with
no data onto the SD Card.The insert SQL string is const char
*insertIndexRecord  = "INSERT INTO tblMetaData VALUES (?1, ?2, ?3, ?4, ?5,
?6)";   The table has the automatic rowid field, and was created with the
following SQL statement:PRAGMA foreign_keys = 0;CREATE TABLE
sqlitestudio_temp_table AS SELECT *                                         
FROM tblMetaData;DROP TABLE tblMetaData;CREATE TABLE tblMetaData (   
dbFilename     TEXT    UNIQUE,    startJD_UTC    DOUBLE  NOT NULL               
           
UNIQUE,    endJD_UTC      DOUBLE  UNIQUE                           NOT NULL,   
numRecords     INTEGER NOT NULL,    IndexRecJD_UTC DOUBLE,    recNum        
INTEGER PRIMARY KEY ASC AUTOINCREMENT                           NOT
NULL);INSERT INTO tblMetaData (                            dbFilename,          
                 
startJD_UTC,                            endJD_UTC,                           
numRecords,                            IndexRecJD_UTC,                          
 
recNum                        )                        SELECT dbFilename,       
                       
startJD_UTC,                               endJD_UTC,                           
   
numRecords,                               IndexRecJD_UTC,                       
       
recNum                          FROM sqlitestudio_temp_table;DROP TABLE
sqlitestudio_temp_table;CREATE UNIQUE INDEX endJD ON tblMetaData (   
startJD_UTC ASC);CREATE UNIQUE INDEX "" ON tblMetaData (    startJD_UTC
ASC);PRAGMA foreign_keys = 1;I thought that maybe the problem was my bind
statement not passing the text correctly, but I traced through the bind
function and it seemed to be OK.I suspect my VFS is the problem.  I am using
memsys5 with about 421k allocated for sqLite.  I am not running out of
memory.  I have two separate databases, one for the metaData and one for the
actual data. I only have one of them open at a time.Could anyone assist
please.I have attached the relevant files in a zip.Best regardsRob
sqLiteInsertTextProblem_001.zip
<http://sqlite.1065341.n5.nabble.com/file/t9217/sqLiteInsertTextProblem_001.zip>
  



--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to