请大家帮忙写个触发器呢!
平生我自如 2009-11-30 02:12:30 我建了个序列:
create sequence H_WO_HEAD_SEQ
minvalue 1
maxvalue 999999
start with 21
increment by 1
cache 20
order;
建了一个数据表:
create table NEW_ORDER
(
NEW_ORDER_NO VARCHAR2(20) not null,//主键
ORDER_NO VARCHAR2(20) not null//外键(wo-head表的主键)
)
现在!我有个sql语句 假如是 :select order_no from table1得到很多order_no ,
我希望一个order_no 配一个H_WO_HEAD_SEQ.nextval 来同步填充在new_order表中!
求大家帮帮忙!如何实现!如果需要触发器!如何写这个触发器!磕头拜谢了!