Luís Santos <lsantos-eZ/[EMAIL PROTECTED]> wrote:
When we create a field with a name composed exclusively of numeric
algarisms, we cannot perform an update.

We have only noticed this odd behaviour because of a NOT NULL field.
See the code example:

   sqlite> CREATE TABLE test (
      ...>       id INT NOT NULL,
      ...>       FieldOne TEXT NOT NULL,
      ...>       FieldTwo TEXT,
      ...>       "1" TEXT
      ...> );
   sqlite> insert into test (id, FieldOne ) values (1, "4");

   sqlite> update test set FieldOne ="1";
   SQL error: test.FieldOne may not be NULL

Seems to work as intended. If the field were named "a" instead of "1", your query would be equivalent to

update test set FieldOne = a;

That is, you set one field to have the same value as another filed in the same row. But since you haven't inserted a value into column "1", it contains NULL. So SQLite complains when you assign NULL to a field declared as NOT NULL.

Did you perhaps mean

   update test set FieldOne ='1';

? Do you understand a difference between single and double quotes in SQL syntax?

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to