Roman <[EMAIL PROTECTED]> writes:

> I know that ALTER TABLE -> ALTER COLUMN is not supported by sqlite3.
>
> I misspelled a column name, and I am curious if there is a command to change 
> the name from sqlite3 interface.

A bit simplistic, but:

echo ".dump" | \
  sqlite3 database.db | \
  sed 's/old_column_name/new_column_name'/g | \
  sqlite3 newdatabase.db

This assumes you're on Linux or equiv.  If you're using Windows, you should be
able to do something similar with:

  sqlite3 database.db
    <enter command ".output database.schema">
    <enter command ".dump"

  <edit database.schema to replace the column name

  sqlite3 newdatabase.db < database.schema

Derrell

Reply via email to