1. 程式人生 > >實現了用正則表示式批量替換更新資料庫資料

實現了用正則表示式批量替換更新資料庫資料

select regexp_replace('e:/fs_root/images/host_21_wangyiblog/2009/11/30/14/00/2009113014000560.jpg','e:/fs_root/(.*?)/[^/.]*?.jpg','//1/') from dual;

update c_pic_logo_n set location=regexp_replace(location,'^e:/fs_root/(.*?)/[^/.]*?.jpg$','//1/') where id=4471;

before ti huan
e:/fs_root/images/host_21_wangyiblog/2009/11/30/14/00/2009113014000560.jpg
arger ti huan
/images/host_21_wangyiblog/2009/11/30/14/00/