把写好的代码粘贴过去
(最后要有'/'符号),回车便可以了,如
CREATE OR REPLACE TRIGGER OnlyPositive
BEFORE INSERT OR UPDATE OF num_col
ON temp_table
FOR EACH ROW
declare
com_num NUMBER;
tran_container t_decl_container%rowtype;
cursor c_get_goods is
select * from t_decl_goods
where decl_no=:new.decl_no;
BEGIN
IF :new.num_col < 0 THEN
RAISE_APPLICATION_ERROR(-20100, 'Please insert a positive value');
END IF;
END OnlyPositive;
/
(最后要有'/'符号),回车便可以了,如
CREATE OR REPLACE TRIGGER OnlyPositive
BEFORE INSERT OR UPDATE OF num_col
ON temp_table
FOR EACH ROW
declare
com_num NUMBER;
tran_container t_decl_container%rowtype;
cursor c_get_goods is
select * from t_decl_goods
where decl_no=:new.decl_no;
BEGIN
IF :new.num_col < 0 THEN
RAISE_APPLICATION_ERROR(-20100, 'Please insert a positive value');
END IF;
END OnlyPositive;
/
解决方案 »
- 安装11g时总卡住
- 请问我想取出记录集的第30之60条记录,应该怎么写呢?我写成where rownum>30 and rownum<60为什么选不出来纪录呢?
- 怎么设置拒绝远程DBA登录
- pl/sql中的package内的存储过程问题,如何判断每条数据的值.请大家帮一下忙
- 如何对clob字段内的内容做搜索匹配
- 新人请教问题,大家请进。。。。。。。。
- 关于linux系统下的oracle安装问题
- 如何查看oracle是64位的还是32位的。
- 如何在一个PL/SQL存储过程中输出一个数据集?
- 询一个关于 wrap 创建加密存储过程没有编译的问题
- pl/sql中如何求几个数中的最小的????
- 如何在PL/SQL块中调用其它用户的对象!
(最后要有'/'符号),回车便可以了,如
CREATE OR REPLACE TRIGGER OnlyPositive
BEFORE INSERT OR UPDATE OF num_col
ON temp_table
FOR EACH ROW
declare
com_num NUMBER;
tran_container t_decl_container%rowtype;
cursor c_get_goods is
select * from t_decl_goods
where decl_no=:new.decl_no;
BEGIN
IF :new.num_col < 0 THEN
RAISE_APPLICATION_ERROR(-20100, 'Please insert a positive value');
END IF;
END OnlyPositive;
/
sql>host vi yourtrigger.sql //写上你的trigger
sql>@yourtrigger.sql //执行该文件就行了
windows下
sql>host edit yourtrigger.sql //写上你的trigger
sql>@yourtrigger.sql //执行该文件就行了
这种方法比较方便,并且易于修改
sql>host vi yourtrigger.sql //写上你的trigger
sql>@yourtrigger.sql //执行该文件就行了
windows下
sql>host edit yourtrigger.sql //写上你的trigger
sql>@yourtrigger.sql //执行该文件就行了
这种方法比较方便,并且易于修改
但是还是报错啊
帮我看看:)
create or replace trigger pricesTouch
after insert or update on prices
for each row
begin
select * from prices;
end pricesTouch;
/SQL> @a.sql
Input truncated to 1 charactersWarning: Trigger created with compilation errors.
after insert or update on prices
for each row
declare
com prices%rowtype;
begin
select * into com from prices where rownum=1;//只能取一条
end pricesTouch;
/
还有,你敲完‘/’后没加回车吧?
还有,你敲完‘/’后没加回车吧?
sql>show error