标签:
问题描述:
采用PowerDesigner15针对Oracle 11g 创建物理数据模型,想实现一个字段的自增,采用如下步骤:
1、创建序列,命名为Sequence_1;
2、在自增字段编辑窗口中,选择序列Sequence_01;
3、将表窗口Preview标签页,生成代码复制到SqlDeveloper 11gr2中执行,编译错误:
PowerDeginer生成的部分代码:
-------------------------------------------------------------------
create or replace trigger CompoundUpdateTrigger_user1
for update on User1 compound trigger
//Declaration
//Body
before statement is
begin
NULL;
end before statement;
before each row is
begin
NULL;
end before each row;
after each row is
begin
NULL;
end after each row;
after statement is
begin
NULL;
end after statement;
END
/
-------------------------------------------------------------------
触发器编译错误如下
错误(29): PLS-00103: 出现符号 "end-of-file"在需要下列之一时: ; <an identifier> <a double-quoted delimited-identifier> 符号 ";" 被替换为 "end-of-file" 后继续。
问题解决;
1、将生成的代码中的 // 修改成 --
2、在END后加上分号(;)
如下:
-------------------------------------------------------------------
create or replace trigger CompoundUpdateTrigger_user1
for update on User1 compound trigger
--Declaration
-- Body
before statement is
begin
NULL;
end before statement;
before each row is
begin
NULL;
end before each row;
after each row is
begin
NULL;
end after each row;
after statement is
begin
NULL;
end after statement;
END;
/
-------------------------------------------------------------------
编译成功提示:
COMPOUNDDELETETRIGGER_USER1 已编译
总结:
在SqlDeveloper中,创建触发器时,在末尾要添加分号(;)和斜杠(/)
1、分号(;)是语句块结束的标识;
2、斜杠(/)是语句块执行的标识;
PowerDesginer 生成的Oracle 11g 组合触发器代码编译错误(29): PLS-00103
标签:
原文地址:http://www.cnblogs.com/yutian/p/5390068.html