SQLite Forum

ALTER TABLE ADD COLUMN problem
Login
Why not retrieve a list of column names in the table, and then add the ones that are not there that you want:

```
select * from pragma_table_xinfo where schema=<schema> and arg=<name>;
```

if the table/view does not exist in the namespace `<schema>` then you will get no rows back.  Of course, a `<name>` can be any table-like object including a view, so if you need to know that it is indeed a table, you will need to ask that as well:

```
select type from <schema>.sqlite_master where name == <name>;
```

which will tell you the type (table/view/index/trigger) of the thing called `<name>` in the <schema> namespace.