MyException - 我的异常网
当前位置:我的异常网» Java相关 » oracle触发器有关问题

oracle触发器有关问题

www.MyException.Cn  网友分享于:2013-12-07  浏览:565次
oracle触发器问题
create table BOOK_INFO(
  "auto_id" number(20) not null primary key,
  "title" varchar2(500) not null,
  "author" varchar2(500) not null,
  "price" number(10,2),
  "press" varchar2(500),
  "publishdate" Date
);
-----------
create sequence book_info_seq
increment by 1 
start with 1  
nomaxvalue  
nocycle  
cache 10;
-------------
create or replace trigger addBook_Info 
before insert on BOOK_INFO 
for each row  
begin
select book_info_seq.nextval into :new.auto_id from dual;
end;
错误:PLS-00049: bad bind variable 'NEW.AUTO_ID'
文本:select book_info_seq.nextval into:new.auto_id from dual;
麻烦各位帮忙看下,麻烦在PL/SQL测试下,谢谢!不知道错哪里了,分有点少,望谅解。

------解决方案--------------------
mysql_query("set names gb2312;");
------解决方案--------------------
REFERENCING NEW new
for each row

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有