بتاريخ: 13 مايو 201313 سنة comment_236100 هذا الكود حاولت فيه مرارا وتكرارا للوصول لنتيجة ولم احصل عليها ارجو الرد وهذا هو الايميل بتاعى [email protected] declare v_total number; mos_main number; count_dy number; --x number;y varchar2(50);z varchar2(50); total_perc number(30,5); mos_perc number(30,5); mos_per_day number(30,5); mos_dy number; total_mos_profit number(30,5); v_all_per number(30,5) ; v_after_dis number(30,5); cursor c_mosahem is select MOSAHEM_ID,MOSAHEM_name,main_percent from MOSAHEM ; v_mosahem c_mosahem%rowtype; begin open c_mosahem; loop fetch c_mosahem into v_mosahem ; exit when c_mosahem%notfound; select sum(main_percent) into v_total from mosahem ; message('v_total='||v_total); message('v_total='||v_total); v_all_per:=(v_total *:control.PROFIT_PERCENT)/100 ; message('v_all_per= '||v_all_per); message('v_all_per= '||v_all_per); select main_percent into mos_main from mosahem where mosahem_id=v_mosahem.mosahem_id; message('mos_main='||mos_main);message('mos_main='||mos_main); mos_perc:=(mos_main/v_total)*100; mos_per_day:=mos_perc/30; message('mos_perc='||mos_perc);message('mos_perc='||mos_perc); message('mos_per_day='||mos_per_day);message('mos_per_day='||mos_per_day); select to_char(reg_date,'dd') into count_dy from mosahem where mosahem_id=v_mosahem.mosahem_id; message('count_dy='||count_dy); message('count_dy='||count_dy); select 30- count_dy into mos_dy from mosahem where mosahem_id=v_mosahem.mosahem_id; message('mos_dy='||mos_dy);message('mos_dy='||mos_dy); if mos_dy>=29 then total_mos_profit:=(to_char(sysdate,'dd')-to_number(count_dy)) * round(mos_per_day,3) ; total_mos_profit:=(v_all_per *mos_perc)/100 ; message('total_mos_profit='||total_mos_profit); message('total_mos_profit='||total_mos_profit); /* if count_dy>=30 then -- total_mos_profit:=(30-to_number(count_dy)) * round(mos_per_day,3) ; total_mos_profit:=(v_all_per *mos_perc)/100 ; message('total_mos_profit' || total_mos_profit); message('total_mos_profit' || total_mos_profit); else set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if; update mosahem set main_percent=mos_main+total_mos_profit where mosahem_id=v_mosahem.mosahem_id ; elsif count_dy<30 then update mosahem set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if;*/ else update mosahem set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if; end loop; close c_mosahem; end; commit; تم تعديل 14 مايو 201313 سنة بواسطة Ahmad.Hasan تقديم بلاغ
بتاريخ: 13 مايو 201313 سنة comment_236101 هذا الكود حاولت فيه مرارا وتكرارا للوصول لنتيجة ولم احصل عليها ارجو الرد وهذا هو الايميل بتاعى [email protected] declare v_total number; mos_main number; count_dy number; --x number;y varchar2(50);z varchar2(50); total_perc number(30,5); mos_perc number(30,5); mos_per_day number(30,5); mos_dy number; total_mos_profit number(30,5); v_all_per number(30,5) ; v_after_dis number(30,5); cursor c_mosahem is select MOSAHEM_ID,MOSAHEM_name,main_percent from MOSAHEM ; v_mosahem c_mosahem%rowtype; begin open c_mosahem; loop fetch c_mosahem into v_mosahem ; exit when c_mosahem%notfound; select sum(main_percent) into v_total from mosahem ; message('v_total='||v_total); message('v_total='||v_total); v_all_per:=(v_total *:control.PROFIT_PERCENT)/100 ; message('v_all_per= '||v_all_per); message('v_all_per= '||v_all_per); select main_percent into mos_main from mosahem where mosahem_id=v_mosahem.mosahem_id; message('mos_main='||mos_main);message('mos_main='||mos_main); mos_perc:=(mos_main/v_total)*100; mos_per_day:=mos_perc/30; message('mos_perc='||mos_perc);message('mos_perc='||mos_perc); message('mos_per_day='||mos_per_day);message('mos_per_day='||mos_per_day); select to_char(reg_date,'dd') into count_dy from mosahem where mosahem_id=v_mosahem.mosahem_id; message('count_dy='||count_dy); message('count_dy='||count_dy); select 30- count_dy into mos_dy from mosahem where mosahem_id=v_mosahem.mosahem_id; message('mos_dy='||mos_dy);message('mos_dy='||mos_dy); if mos_dy>=29 then total_mos_profit:=(to_char(sysdate,'dd')-to_number(count_dy)) * round(mos_per_day,3) ; total_mos_profit:=(v_all_per *mos_perc)/100 ; message('total_mos_profit='||total_mos_profit); message('total_mos_profit='||total_mos_profit); /* if count_dy>=30 then -- total_mos_profit:=(30-to_number(count_dy)) * round(mos_per_day,3) ; total_mos_profit:=(v_all_per *mos_perc)/100 ; message('total_mos_profit' || total_mos_profit); message('total_mos_profit' || total_mos_profit); else set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if; update mosahem set main_percent=mos_main+total_mos_profit where mosahem_id=v_mosahem.mosahem_id ; elsif count_dy<30 then update mosahem set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if;*/ else update mosahem set main_percent=(mos_per_day*mos_dy)+main_percent where mosahem_id=v_mosahem.mosahem_id ; end if; end loop; close c_mosahem; end; commit; محدش فاهم المشكلة فين فمحدش هيعرف يجاوبك ايه الايرور ؟ فيه ايرور اصلا ولا فين المشكلة ؟ تقديم بلاغ
بتاريخ: 13 مايو 201313 سنة comment_236103 use exception too many rows and no date_found to found the problem good luck تقديم بلاغ
بتاريخ: 14 مايو 201313 سنة comment_236115 السلام عليكم اخي عشان نساعدك اشرح لنا المشكلة وارفق لنا الفورم تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.