简单的pl/sql问题

djboy 2002-09-02 05:43:01
我写了一个触发器, 代码如下:
create or replace trigger set_TblUserInfo_no
before insert on tbluserinfo
for each row
declare
next_no number;
begin
select TblUserInfo_seq.NEXTVALUE into next_no from dual;
:NEW.ID: = next_no;
end set_TblUserInfo_no;

在pl/sql developer中运行总是提示:
:NEW.ID : = next_no; 有错, (PLS-00103)
请问这是什么错误, oracle中那里可以根据错误号查出错误信息?
多谢了.
...全文
21 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
djboy 2002-09-02
  • 打赏
  • 举报
回复
谢了.
penitent 2002-09-02
  • 打赏
  • 举报
回复
oracle reference上有。还有oracle的很多电子文档中也有!
如oracle帮助
djboy 2002-09-02
  • 打赏
  • 举报
回复
to jlandzpa(ORA-00600)
PLS-00103的错误信息从哪里查? 我刚接触oracle.:(
penitent 2002-09-02
  • 打赏
  • 举报
回复
本来就是NextVal,那本书上说是NEXTVALUE ???
jlandzpa 2002-09-02
  • 打赏
  • 举报
回复
PLS-00103 found str but expected one of the following: str

Cause This error message is from the parser. It found a token (language element) that is inappropriate in this context.
Action Check previous tokens as well as the one given in the error message. The line and column numbers given in the error message refer to the end of the faulty language construct.

Copyright (C) 1998, Oracle Corporation
penitent 2002-09-02
  • 打赏
  • 举报
回复
PLS-00103: found str but expected one of the following: str
Cause: This error message is from the parser. It found a token (language element) that is inappropriate in this context.

Action: Check previous tokens as well as the one given in the error message. The line and column numbers given in the error message refer to the end of the faulty language construct.
djboy 2002-09-02
  • 打赏
  • 举报
回复
多谢大家, 我已经编译成功了, 上面的语句有2个错误:
1.:new.ID: = next_no; 正确的是 :new.ID := next_no;
2. TblUserInfo_seq.NEXTVALUE 正确的是 TblUserInfo_seq.Nextval
可见书上写的也不全对呀.:)
penitent 2002-09-02
  • 打赏
  • 举报
回复
PLS-00103
不好意思,我查错了,以上的错误大家都说了,
就是:=该连着写,我帮你查查PLS-00103
penitent 2002-09-02
  • 打赏
  • 举报
回复
PLS-00103
不好意思,我查错了,以上的错误大家都说了,
就是:=该连着写,我帮你查查PLS-00103
penitent 2002-09-02
  • 打赏
  • 举报
回复
ORA-00103: invalid network protocol; reserved for use by dispatchers
Cause: The network specified in Net8 CONNECT string is reserved for use by the dispatchers.

Action: Specify other network protocols in the CONNECT string.
你怎么会有这种错误???奇怪!
jlandzpa 2002-09-02
  • 打赏
  • 举报
回复
NEW.ID : = :next_no; 不对吧.
penitent 2002-09-02
  • 打赏
  • 举报
回复
NEW.ID : = :next_no;?????
to bzszp(SongZip),为什么要加:号。
另外: =要连着写,是一个符号

bzszp 2002-09-02
  • 打赏
  • 举报
回复
我怎么老掉东西,new前面的冒号
:NEW.ID : = :next_no;
yuanscar 2002-09-02
  • 打赏
  • 举报
回复
TblUserInfo_seq.NEXTVALUE可能还没有得到值
直接让next_no :=:new.TblUserInfo_seq试试看。
不知道是不是这样,你把表的字端列出来看看啊!
Michaelyfj 2002-09-02
  • 打赏
  • 举报
回复
......
begin
select TblUserInfo_seq.NEXTVALUE into next_no from dual;
:NEW.ID: = next_no;
end set_TblUserInfo_no;

改成:
......
begin
select TblUserInfo_seq.NEXTVALUE into next_no from dual;
:NEW.ID := next_no; --赋值是 :=, 而不是 : =
^^^^
end set_TblUserInfo_no;
bzszp 2002-09-02
  • 打赏
  • 举报
回复
NEW.ID : = :next_no;
jlandzpa 2002-09-02
  • 打赏
  • 举报
回复
:NEW.ID: = next_no; ------> :NEW.ID:= next_no;

17,081

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧