当前位置: 代码迷 >> Oracle开发 >> oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?解决思路
  详细解决方案

oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?解决思路

热度:76   发布时间:2016-04-24 06:48:28.0
oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?
各位高手,请问oracle在用insert into select插入数据后,怎样获得新插入的数据的字段值?
------解决方案--------------------
表中的数据根据条件才能筛选出来。
比如你新插入的是今天的数据,有时间字段,就根据时间条件进行筛选。
------解决方案--------------------
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
  相关解决方案