日期:2014-05-17  浏览次数:21085 次

oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?
各位高手,请问oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?
oracle

------解决方案--------------------
表中的数据根据条件才能筛选出来。
比如你新插入的是今天的数据,有时间字段,就根据时间条件进行筛选。
------解决方案--------------------
insert。。。select 。。。from table t where 。。。returning t.id bulk collect v_type;
其中:
v_type类型:
type v_typ is table of number index by binary_integer;
然后循环读取v_type(i)
------解决方案--------------------
引用:
insert。。。select 。。。from table t where 。。。returning t.id bulk collect v_type;
其中:
v_type类型:
type v_typ is table of number index by binary_integer;
然后循环读取v_type(i)
+1