Hi, why this code consume free memory ?

the same code but 'UPDATE' works fine....

any help?



#include <stdio.h>
#include <stdlib.h>
#include "sqlite3.h"

int main(int argc, char **argv)
{
        sqlite3 *db;
        char *zErrMsg = 0;
        int rc;
        char st1[200];


        sqlite3_initialize();


//      sprintf (st1,"UPDATE Table1 SET Temp = %d WHERE Id = %d",1,1);
        sprintf (st1,"INSERT INTO Table1 (Id, Temp,Data) VALUES 
(%d,1,'1234')",1);


        sqlite3_soft_heap_limit(10);

        rc = sqlite3_open("pippo.sqlite", &db);
        if( rc )
        {
                fprintf(stderr, "Can't open database: %s\n", 
sqlite3_errmsg(db));
                sqlite3_close(db);
                exit(1);
        }

        rc = sqlite3_exec(db,"PRAGMA cache_size=0;", 0, 0, &zErrMsg);
        if( rc!=SQLITE_OK )
        {
                fprintf(stderr, "SQL error: %s\n", zErrMsg);
                sqlite3_free(zErrMsg);
        }

        rc = sqlite3_exec(db,"CREATE TABLE Table1(Id INTEGER,Temp INTEGER,Data
TEXT);", 0, 0, &zErrMsg);
        if( rc!=SQLITE_OK )
        {
                fprintf(stderr, "SQL error: %s\n", zErrMsg);
                sqlite3_free(zErrMsg);
        }


        do
        {




                rc = sqlite3_exec(db,st1, 0, 0, &zErrMsg);
                if( rc!=SQLITE_OK )
                {
                        fprintf(stderr, "SQL error: %s\n", zErrMsg);
                        sqlite3_free(zErrMsg);
                }


        } while (1);

        sqlite3_close(db);

        
        
        return 0;
}
-- 
View this message in context: 
http://old.nabble.com/sqlite-memory-consume..-tp28068504p28068504.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to