sql - sqlite: no column after alter table -
i try add column existing table, , use it:
sqlite> create table tst(id_key integer primary key, s1 text); sqlite> .tables tst sqlite> insert tst (s1) values ("aa"); sqlite> select * tst; 1|aa sqlite> alter table tst add colum s2 text not null default "bb"; sqlite> select * tst; 1|aa|bb sqlite> .schema tst create table tst(id_key integer primary key, s1 text, colum s2 text not null default "bb"); so looks fine.
but
sqlite> select s2 tst; error: no such column: s2 so in scheme there "s2" column, sole record contains data in "s2" field, sqlite don't know column s2.
what wrong, used "alter table" in wrong way?
your column not named s2, colum. check alter table spelling.
sqlite> select colum tst; bb this question should closed, typo.
btw, code should formatted 4 spaces in front, not text quote; gives monospace font , syntax highlighting; latter might have helped see problem ^^
Comments
Post a Comment