DECLARE CURSORRecordcursor is SELECTLongitude,latitude fromWr_wiust_b_sec for UPDATE; Recordrow recordcursor%ROWTYPE;BEGIN OPENRecordcursor; LOOPFETCHRecordcursor intoRecordrow; IFRecordcursor%NOTFOUND Then EXIT; ELSE UPDATEWr_wiust_b_secSETLongitude=(SelectSUBSTR (To_char (Dbms_random.value ()*(116.280858-108.362376)+108.362376),0,Ten) fromdual), Latitude=(SelectSUBSTR (To_char (Dbms_random.value ()*(33.257267-29.040321)+29.040321),0,Ten) fromdual)WHERE Current ofRecordcursor; END IF; ENDLOOP; COMMIT; CLOSERecordcursor;END;Commit;
Insert intoSt_pptn_r_temp (STCD, TM, DRP, INTV, PDR, DYP, wth,datetime)(Select distinctT.STCD, T.tm, T.DRP, T.intv, T.PDR, T.dyp, T.wth, T.datetime fromSt_pptn_r TInner JoinSt_stbprp_b_temp B onB.stcd=T.stcdwhereT.tm>=To_date ('2014-05-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') andT.tm<=To_date ('2014-10-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') );Insert intost_river_r_temp (STCD, TM, Z, Q, Xsa, XSAVV, XSMXV, FLWCHRCD, WPTN, MSQMT, Msamt, MSVMT) (Select distinctT.STCD, T.tm, T.z, T.Q, T.xsa, T.XSAVV, T.XSMXV, T.FLWCHRCD, T.WPTN, T.MSQMT, T.msamt, T.MSVMT fromSt_river_r TInner JoinSt_stbprp_b_temp B onB.stcd=T.stcdwhereT.tm>=To_date ('2014-05-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') andT.tm<=To_date ('2014-10-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') );Insert intost_rsvr_r_temp (STCD, TM, RZ, Inq, W, Blrz, OTQ, RWCHRCD, RWPTN, INQDR, MSQMT) (Select distinctR.STCD, R.tm, R.rz, R.inq, R.W, R.blrz, R.OTQ, R.RWCHRCD, R.RWPTN, R.INQDR, R.MSQMT fromSt_rsvr_r RInner JoinSt_stbprp_b_temp B onB.stcd=R.stcdwhereR.tm>=To_date ('2014-05-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') andR.tm<=To_date ('2014-10-01 08:00:00','YYYY-MM-DD Hh24:mi:ss') );
1 . Languages and encodings 2 time format 1 with alter session > alter session set Nls_date_format= " yyyy-mm-dd hh24 : Mi:ss " ; 2 in the OS set Nls_date_format= yyyy- mm- DD HH24:MI:SS
Update fields with random numbers in Oracle----Insert data from one table into another table----environment settings