>The code looks OK except for the typo (i.e. sPre[2048[ should be
>
sPre[2048]).
Yes, It's a mistype on the mailinglist, the code it's ok!
> I assume that your real table isn't named "table" since that is a
keyword.
The real table name is "inputai"
> Can you open the database
file using the sqlite3 command line utility
> and execute a select
query to return or count the number of rows that
> match your update
condition?
Yes. I can open the database and I can run with success the
same command.
I copy and paste the program output (printf sql) to
sqlite3 command line utility then I press Return and the table is
updated!!!
>select count(*) from your_table where Address=7 and Port=1
> If that gives a zero result you have your answer.
I've got "1"
>You
might also want to show the create statement you used for the table
>you are trying to update.
I create the table using some code:
int
create_input_ai()
{
int rc;
char sql[512];
char *zErrMsg = 0;
printf("CREATE_INPUT_AI\n");
strcpy(sql,"CREATE TABLE inputai
(Address INTEGER,PortDescription TEXT,PortNumber INTEGER,PortType TEXT,
PortResolution INTEGER,Value REAL,UM TEXT,"\
"RangeMin REAL,RangeMax
REAL,Offset REAL,MinL REAL,MinLL REAL,MaxH REAL,MaxHH REAL,Delay
INTEGER,Hysteresis INTEGER,Alarm TEXT,Users TEXT,"\
"Action TEXT,
Monitor TEXT,TimeStamp TEXT,TimeAlarm TEXT);");
rc = sqlite3_exec(db,
sql, NULL, NULL, &zErrMsg );
if( rc!=SQLITE_OK )
{
fprintf(stderr,
"SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
return(-1);
}
return(0);
}
I don't know where I must crash my head :-(
Pierluigi Bucolo
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users