The code is very long, I'll try to put here the core of my application.
I'm using a C++ Class where one function is "sqlraw" that I use to 
execute a SQL statement:

CLASS DEFINITION

sqlite3 *db;

int expander::
open_db(char * pDbName)
{
        int rc;
        
        rc = sqlite3_open(pDbName, &db);
        
if( rc )
        {
           fprintf(stderr, "Can't open database: %s\n", 
sqlite3_errmsg(db));
           sqlite3_close(db);
           exit(1);
        }
        return(0);
}


int expander::sqlraw(char *pSql)
{
        int rc; 
        char *zErrMsg = 0;
        
        
printf("SQLRAW: SQL=%s\n",pSql);
        printf("Database %d\n",db);
        rc = 
sqlite3_exec(db,pSql, NULL, NULL, &zErrMsg );
        printf("SQLRAW: Stato=%d 
- OK=%d\n",rc, SQLITE_OK);
        if( rc!=SQLITE_OK )
        {
                fprintf(stderr, 
"SQL error: %s\n", zErrMsg);
                sqlite3_free(zErrMsg);
                return(-1);
        }
        
return(0);
}

int main(int argc ,char *argv[])
{
   expander expio;
   
char sPre[2048[;
   
   expio.open("test.db");

   strcpy(sPre,"UPDATE 
table SET Value=12.3 WHERE Address=7 and Port=1");

   if (expio.sqlraw
(sPre) == 0)
   {
       / / Action for no error
   }
   else
   {
      // Manage error conditions
   }


When I execute the code, sqlraw 
function print the pSql string, and this is the same I pass.
The 
Database descriptor is the same returned from open function, and status 
code is OK!!!

But table value isn't updated.

I don't understand 
what's matter, and because i haven't any error message I can't debug 
it.

Any suggestion is VERY VERY appreciate

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

Reply via email to