آقا جواب نگرفتم
من چطور می تونم همچین دستوری رو برای update بنویسم
insert INTO ShiftItemDef SELECT @TypeShiftId as TypeShiftId, DBDATE,... FROM ShiftItemDef
WHERE (TypeShiftId = @IdxTypeShiftId) AND (DBDATE BETWEEN @SDate AND @EDate)
این دستور الان رکود های مورد نظر رو به جدول اضافه می کنه درحالی که رکورد های برای این کد وجود دارد که باید این رکود ها درون اونها update بشن
در رابطه با cursor هم موافقم اما نتونستم چیز زیادی از اون در بیارم تو سایت که فقط پیشنهاد شده بود از این روش استفاده کنید اما این مثال رو تو گوگل پیدا کردم که زیاد ازش سر در نیاوردم
http://www.adp-gmbh.ch/ora/plsql/cur...or_update.html
set feedback off
create table f (a number, b varchar2(10));
insert into f values (5,'five');
insert into f values (6,'six');
insert into f values (7,'seven');
insert into f values (8,'eight');
insert into f values (9,'nine');
commit;
create or replace procedure wco as
cursor c_f is
select a,b from f where length(b) = 5 for update;
v_a f.a%type;
v_b f.b%type;
begin
open c_f;
loop
fetch c_f into v_a, v_b;
exit when c_f%notfound;
update f set a=v_a*v_a where current of c_f;
end loop;
close c_f;
end;
/
exec wco;
select * from f;
drop table f;
drop procedure wco;