[Kexi] Error when running ksqlite_add_column.sh

Kevin ALLIX kallix at kallix.net
Thu Jan 4 08:13:16 CET 2007


Le Thursday 04 January 2007 02:MM, wayne a écrit :
> When I run the add column script, "ksqlite_add_column.sh" it results in the
> following error message after displaying the contents of 3 records:
>
> SQL error: table ebaynov2006kexi has 36 columns but 35 values were supplied
>
> What does this message mean?

Your old database had 35 fields (i.e. each record has 35 values). 
The new one obviously has 36 fields, and therefore each record _should_ have 
36 values. In this case, it seems that the script failed to add one more 
value to 3 records of the old db.

Could you post the content of the 3 faulty records?

>
> The end result is that the 3 records are deleted from the database.
> However, the column that I intended to add has been added.
>
> How can I run this script in the future without losing data?

Wait for it to be fixed ;) In the meantime, make sure your database is 
backuped before running this script.

It seems to me that this problem has to do the 
sed -e "s/\(^INSERT.*\));$/\\1, NULL);/g" part of the script that assumes 
sqlite dumps provides all values : that is to say INSERT INTO xx values (v1, 
v2, ..., v35); even if v35 is NULL or '' or the default value.

Would it be possible for you to build a kexi database containing only 2 
records: 1 taken from the 3 faulty ones, and 1 which was ok ?
Then the output of 
echo ".dump '$table_name';" | ksqlite -noheader  "$database_name"   would be 
helpful.


Kevin



More information about the Kexi mailing list