Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在sqlite中创建触发器时出现语法错误_Sqlite_Syntax_Triggers - Fatal编程技术网

在sqlite中创建触发器时出现语法错误

在sqlite中创建触发器时出现语法错误,sqlite,syntax,triggers,Sqlite,Syntax,Triggers,以下代码导致SQLite中出现语法错误。 我想这一定很简单,但我看不出来 我有两个表格,页面和项目,通过文本代码链接。当这个代码在pages表中更改时,我希望它在items表中也更改 SQLite版本非常旧,3.7.7.1,但我在版本历史中没有看到过这样的问题。这发生在Windows上,使用PHP5.3.1 CREATE TABLE IF NOT EXISTS "efpage" ( "pageid" integer NOT NULL PRIMARY KEY, "psite" text NULL,

以下代码导致SQLite中出现语法错误。 我想这一定很简单,但我看不出来

我有两个表格,页面和项目,通过文本代码链接。当这个代码在pages表中更改时,我希望它在items表中也更改

SQLite版本非常旧,3.7.7.1,但我在版本历史中没有看到过这样的问题。这发生在Windows上,使用PHP5.3.1

CREATE TABLE IF NOT EXISTS "efpage" ( "pageid" integer NOT NULL PRIMARY KEY, "psite" text NULL, "pgcode" text NULL ); 
CREATE TABLE IF NOT EXISTS "efitem" ( "itemid" integer NULL PRIMARY KEY , "isite" text NULL, "ititle" text NULL,  "inpage" text NULL); 

DROP TRIGGER IF EXISTS update_pagecode;
CREATE TRIGGER update_pagecode AFTER UPDATE OF pgcode ON efpage
BEGIN
UPDATE efitem SET inpage = new.pgcode WHERE inpage = old.pgcode;
END;    
由此产生的错误是 “pgcode”附近出错:语法错误

尝试不同的方法,我发现语法错误在“old.pgcode;”之后,如CL所示

这链接到SQLite的版本。 我在windows上使用与PHP捆绑的SQLite

我的下一个(已回答)问题是:

对我有用(3.8.9)。