oracle 循环更新表的数据



DECLARE P_INT NUMBER(19);


BEGIN

 P_INT := 1;

 FOR L_RECORD IN (SELECT region_name,region_id FROM region_last where region_type=2 ORDER BY region_id ASC) LOOP    //查询region表的内容

    UPDATE hotel

       SET city = L_RECORD.REGION_ID

     WHERE city = L_RECORD.Region_Name;                         //更新hotel表的内容

    P_INT := P_INT + 1;

 END LOOP;
 
 END;
展开阅读全文

没有更多推荐了,返回首页