More on 'works only for small strings':

I replaced the sqlite3_exec code with sqlite3_prepare(),
sqlite3_step() and sqlite3_finalize() only to find that it produced
the same 'logic error' [SQLITE_ERROR] in the step() function.

Then, I changed the way I create the record (below) to where I
create an initial short record and then sequentially UPDATE each
column.  The UPDATE fails exactly when the total size of the
record exceeds 1024 bytes.  In the 'for' loop, it attempts 16 UPDATES
but fails after 8 of them, there being 128 bytes per column in the UPDATE.

The CL prog, sqlite3.exe displays a record of 1027 characters, the last 8
columns
being blank.  I have done C++ gymnastics to triangulate this problem and
everything
seems consistent with the assertion that I cannot create a record that
exceeds 1024 bytes, strange as that may seem.


Am now thinking there's something wrong with how sqlite gets compiled....
(using MS Vers 6 Visual Studio)
The sqlite source shows:
** This amalgamation was generated on 2008-04-16 15:43:25 UTC.

BTW, some SQL document referenced a 'size' attribute of the database having
a property of 'tiny', 'medium', or 'large'.  I have no idea what this might
mean.

dave

The C++ code:
strSql.Format( "insert or replace into Event values( '%s', '%s', '%s', '%s',
'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',
'%s', '%s', '%s' );", strKey, szSQLDateTime, strArgs + " /t " + szDateTime,
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" );

sqlite3_exec( m_pdbData, strSql, &Callback, this, &lpszErr );  // this works
ok

for( int i=0; i<16; i++ )  {
    if( !m_strMotionData[i].IsEmpty() )  {
        CString strQ;
        strQ.Format( "UPDATE Event SET MotionData%d = '%s' WHERE Key =
'%s';", i+1, m_strMotionData[i], strKey );
        if( sqlite3_exec( m_pdbData, strQ, &Callback, this, &lpszErr ) != 0
)  {  // fails when total record exceeds 1024 chars
             FireOnError( "update err" );
             FireOnError( m_strMotionData[i] ); // list data... shows 128
bytes of '0' chars
             }
         }
      }
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to