SQLite通过select语句改变表的结果

我试图在mozilla sqlite附加组件中执行这个语句

alter table (select tbl_name from sqlite_master where rowid=1) add GUID varchar 

但是这会导致错误:

SQLiteManager:可能的SQL语法错误:alter table(从sqlite_master where rowid = 1中selecttbl_name)添加GUID varchar [near“(”:syntax error]exception名称:NS_ERROR_FAILUREexception消息:组件返回失败代码:0x80004005(NS_ERROR_FAILURE)[mozIStorageConnection。的createStatement]

声明:从sqlite_masterselecttbl_name其中rowid = 1正常工作

你不能这么做:在SQL中,表名和列名必须是embedded在SQLstring本身中的标识符。 它们不能来自您查询的值,甚至不能来自查询参数。

您需要select表名,制作alter table语句,然后单独执行。