创建触发器时出现 PLS-00049: 错误的赋值变量 ':NEW.land_name'
2008-05-13 15:57
786 查看
create or replace trigger t_hang_info
before insert or update or delete on hang_info
for each row
declare
pbCount number;
begin
select count(LANDID) into pbCount from TRADECENTER_LANDHANG where LANDID = :new.land_no;
if inserting or updating then
if pbCount<=0 then
insert into TRADECENTER_LANDHANG (
INFORID,
LANDID,
LANDNAME,
STARTTIME,
ENDTIME,
HIGHESTPRICE,
INCPRICE
) values (
:new.hang_no,
:new.land_no,
:new.land_name,
:new.hang_start_date,
:new.hang_end_date,
:new.hang_start_price,
:new.hang_inc_price
);
else
update TRADECENTER_LANDHANG set
INFORID = :new.hang_no,
LANDID = :new.land_no,
LANDNAME = :new.land_name,
STARTTIME = :new.hang_start_date,
ENDTIME = :new.hang_end_date,
--HIGHESTPRICE = :new.hang_start_price,
INCPRICE = :new.hang_inc_price
where landid = :new.land_no;
end if;
end if;
if deleting then
delete from TRADECENTER_LANDHANG where landid = :old.land_no;
end if;
end;
两个带颜色的地方报错
PLS-00049: 错误的赋值变量 ':new.land_name'
PLS-00049: 错误的赋值变量 ':new.land_name'
检查表结构后发现是我已经把land_name字段总表hang_info中删除了,所以造成这样的错误,加上之后就测试通过了。
before insert or update or delete on hang_info
for each row
declare
pbCount number;
begin
select count(LANDID) into pbCount from TRADECENTER_LANDHANG where LANDID = :new.land_no;
if inserting or updating then
if pbCount<=0 then
insert into TRADECENTER_LANDHANG (
INFORID,
LANDID,
LANDNAME,
STARTTIME,
ENDTIME,
HIGHESTPRICE,
INCPRICE
) values (
:new.hang_no,
:new.land_no,
:new.land_name,
:new.hang_start_date,
:new.hang_end_date,
:new.hang_start_price,
:new.hang_inc_price
);
else
update TRADECENTER_LANDHANG set
INFORID = :new.hang_no,
LANDID = :new.land_no,
LANDNAME = :new.land_name,
STARTTIME = :new.hang_start_date,
ENDTIME = :new.hang_end_date,
--HIGHESTPRICE = :new.hang_start_price,
INCPRICE = :new.hang_inc_price
where landid = :new.land_no;
end if;
end if;
if deleting then
delete from TRADECENTER_LANDHANG where landid = :old.land_no;
end if;
end;
两个带颜色的地方报错
PLS-00049: 错误的赋值变量 ':new.land_name'
PLS-00049: 错误的赋值变量 ':new.land_name'
检查表结构后发现是我已经把land_name字段总表hang_info中删除了,所以造成这样的错误,加上之后就测试通过了。
相关文章推荐
- 创建触发器时出现 PLS-00049: 错误的赋值变量 ':NEW.modify_man'
- 编译wince6.0出现错误提示:fatal error U1077: 'res2res' : return code '0xffffffff'
- ASP.NET 创建母版页导致js出现“ 'document.getElementById(...)' 为空或不是对象”错误
- iOS导入三方框架出现"Unknown type name 'NSString'"错误
- command line warning #10006: ignoring unknown option '/NODEFAULTLIB'错误解决(XPDF编译时出现的问题)
- 一般c++编译出现"name lookup of '变量名' changed [enabled by default]"的警告
- 升级android sdk到5.0,创建项目错误:No resource found that matches the given name 'android:Widget...... '解决方法
- 解决bs4在Python 3.5下出现“ImportError: cannot import name 'HTMLParseError'”错误
- 创建触发器时提示错误信息:不能在 'inserted' 表和 'deleted' 表中使用 text、ntext 或 image 列
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- Android Studio 出现非法字符 'ufeff'错误
- [python]用eval强制将字符串转换为字典变量时候出错:NameError: name 'null' is not defined[python]用eval函数 字符串转dict
- 编译VTK6.1.0在vtkGUISupportQt-6.1.dll项上出现错误'GLdouble' : redefinition的解决方法
- 交叉编译中出现的 'Undefined reference to __aeabi_read_tp' 错误
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
- vs.net C# 连接数据库 出现错误 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关联
- 常用命令图解 & & git 错误 fatal: Not a valid object name: 'master'.
- 用命令连接mysql , 出现'mysql' is not recognized as an internal or external command错误解决
- 轻松解决 'MSISR.PRODUCTNAME' 错误
- 1.flex工程报错出现每次打开窗口的时候都会弹出一个窗口提示错误,提示“a problem has occurred when opening project "your project name",try to restart the applicat