create or replace trigger tr_tai_ologrec_serial_i before insert on tai_ologrec
for each row
declare
-- local variables here
begin
if :new.olog_num is null then
select q_tai_ologrec.nextval into :new.olog_num from dual;
end if;
endtr_tai_ologrec_serial_i;
for each row
declare
-- local variables here
begin
if :new.olog_num is null then
select q_tai_ologrec.nextval into :new.olog_num from dual;
end if;
endtr_tai_ologrec_serial_i;
解决方案 »
- oracle sql developer快捷键问题
- linux导出oracle下所有对象!
- 急dataset的问题
- 在ORACLE 中数据变化时,用什么向外程序发消息通知?
- Oracle 大侠:用sys登陆报错: "java.lang.Exception: No such metric"
- 奇怪的问题,关于类型NVARCHAR2
- 触发器的编译错误!!
- ORACLE表利用序列实现自增字段的问题
- 很着急,在线等,求救了! ORA-02049 超时分布式事务处理等待锁定
- 求一条sql
- drop table 报ora-00942 表或者视图不存在?
- 在EXCEL中有回车换行的内容导入Oracle中却不自动换行,变成内容都连一行了,请问怎么解决?
select q_tai_ologrec.nextval into :new.olog_num from dual;
--改为下面试下
:new.olog_num := q_tai_ologrec.nextval;
然后:new.olog_num := 变量;create or replace trigger tr_tai_ologrec_serial_i
before insert on tai_ologrec
for each row
declare
v_val int := 0;
begin
if :new.olog_num is null then
select q_tai_ologrec.nextval into v_val from dual;
:new.olog_num := v_val;
end if;
end tr_tai_ologrec_serial_i;
要分开end tr_tai_ologrec_serial_i;
或直接用end;就可以了