Hi y'all,
Using SQLite I need to copy nearly all of an existing row from a table, make a change to a single column, and insert the new row into the table. Something roughly like
INSERT INTO $tablename (c1, c2, ... , cn)
SELECT (c1, c2, ... , cn) FROM $tablenam
I tried substituting a some value ci into the the list of SELECT columns. This works if the value is a float or an integer, but not if it is a string. If the value is a string, SQLite interprets it as a column name, which naturally doesn't exist and I get an error.
I can write code to perform this operation, but I was hoping to do it in one query.
If of relevance, I am currently coding in tcl.
Thanks,
Sean