表结构如下:
CREATE TABLE [ElemProp] (
[_idElemProp] GUID DEFAULT ('{' || hex( randomblob(4)) || '-' || hex( randomblob(2)) || '-' || '4' || substr( hex( randomblob(2)), 2) || '-' || substr('AB89', 1 + (abs(random()) % 4) , 1) || substr(hex(randomblob(2)), 2) || '-' || hex(randomblob(6)) || '}'),
[_ridElem] GUID,
[_sElemPropName] VARCHAR DEFAULT (''),
[_sElemPropCatName] VARCHAR DEFAULT (''),
[_nElemPropValidRule] INTEGER DEFAULT (0),
[_dElemPropMaxVal] DOUBLE DEFAULT (0),
[_dElemPropMinVal] DOUBLE DEFAULT (0),
[_nElemPropCtrlFlag] INTEGER DEFAULT (0), [_nElemPropOrder] DOUBLE DEFAULT (0),
UNIQUE([_ridElem], [_sElemPropName]) ON CONFLICT IGNORE,
CONSTRAINT [sqlite_autoindex_ElemProp_2] PRIMARY KEY ([_idElemProp]));
CREATE INDEX [ElemPropIndex] ON [ElemProp] ([_sElemPropName], [_ridElem]);
CREATE TRIGGER [DeletedLinkedElemPropVal]
AFTER DELETE
ON [ElemProp]
BEGIN
DELETE FROM [ElemPropVal] where [ElemPropVal].[_ridElemProp] = old.[_idElemProp];
END;
其中
_nElemPropOrder的字段类型错了,我想修改成integer,于是写下sql如下
alter table [ElemProp]
alter column [_nElemPropOrder] INTEGER DEFAULT (0);
但是执行总提示在alter附近有误,请高手指点一下,谢谢
有只小跳蛙
倚天杖
相关分类