首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >图书馆管理系统中增加图书的增值问题

问图书馆管理系统中增加图书的增值问题
EN

Stack Overflow用户
提问于 2016-01-19 18:34:08
回答 1查看 316关注 0票数 0
代码语言:javascript
复制
create or replace TRIGGER book_s_t3
AFTER INSERT ON trans_s
FOR EACH ROW
begin
    UPDATE book_s
    SET no_of_books = :old.no_of_books + :new.no_of_books;
    WHERE no_of_books = :new.no_of_books;
end;

获取错误的原因:

代码语言:javascript
复制
Compilation failed, line 3 (10:27:39) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'OLD.NO_OF_BOOKS'Compilation failed, line 3 (10:27:39) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'NEW.NO_OF_BOOKS'Compilation failed, line 4 (10:27:39) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'NEW.NO_OF_BOOKS'Compilation failed, line 4 (10:27:39) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol "WHERE" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge 
EN

回答 1

Stack Overflow用户

发布于 2016-01-19 19:33:46

有一系列语法错误使你无法编译触发器。请参阅下面的代码片段

代码语言:javascript
复制
CREATE OR REPLACE TRIGGER book_s_t3 AFTER
  INSERT ON trans_s FOR EACH ROW
  DECLARE
BEGIN
  UPDATE book_s
  SET no_of_books   = :old.no_of_books + :new.no_of_books
  WHERE no_of_books = :new.no_of_books;
END;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34874491

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档