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

oracle怎么实现批量存储的功能
有个字符串01.02,03.01,03.01.1,……是以逗号隔开的字符串,想按逗号拆开存储到数据库中,存储数据如下:
    ctext
     01.02
     03.01
     03.01.1
…………
几个逗号就几条。oracle如何快速插入?

------解决方案--------------------
with b as(
 select '01.02,01.03,01.04,01.05'  as m from dual
 )
 select nvl(regexp_substr(m,'\d+.\d+',1,level) ,'NULL')as s from b connect by level<7
之后就得到了
SQL> with b as(
  2   select '01.02,01.03,01.04,01.05'  as m from dual
  3   )
  4   select nvl(regexp_substr(m,'\d+.\d+',1,level) ,'NULL')as s from b connect by level<7
  5  ;
 
S
----------------------------------------------
01.02
01.03
01.04
01.05
NULL
NULL
 
6 rows selected
去空。然后使用select  ino 语句试试怎么插入

------解决方案--------------------
可以用SQLLDR来加载,然后使用并行、直接路径加载方式