Login or sign up Lost password?
Login or sign up
Create a stored procedure like this - assuming that pk is the primary key of table1: for select table1.pk, t2.f1, t2.f2 from table1, t2 where table1= t2into :v_pk, :v_f1, :v_f2 do begin update table1 set f1 = :v_f1, f2 = :v_f2 where table1= :v_pk end; source: Ann Harrison on listserv PL/SQL ORACLE PROCEDURE (WALIKHAN09): DECLARE v_F1 T2. F2%TYPE; /* cursor declaration */ CURSOR c_ct IS SELECT FI, F2 FROM T2; BEGIN OPEN c_ct; LOOP FETCH c_ct INTO v_F1, v_F2; /* if there are no more rows to fetch, exit the loop */ EXIT WHEN c_ct%NOTFOUND;/* UPDATING TABLE */UPDATE T1 a SET a.