بتاريخ: 16 أبريل 201213 سنة comment_223326 لمنع تداخل التواريخ في البلوك الفرعي عند الادخال date overlopping is not prmitted in details block لدينا جدولين master create table itemss (item_code number(5),name varchar2(50),constraint pk_itemss primary key (item_code) ); Detail create table prices (price_code number(5) ,date_from date , date_to date , price number (5) , item_code number(5) );alter table prices add constraint pk_prices primary key (price_code)alter table prices add constraint fk_prices foreign key (item_code) references itemss (item_code); [/center] وهذه صورة البلوكين على الفورم http://imageshack.us.../823/dates.jpg/ مع العلم ان كل صنف item له اكثر من سعر بختلاف التاريخ والسوال كيف يمكن منع تداخل التواريخ في البلوك الفرعي الاسعار prices عند الادخال اسعار جديده في الانتظار... تم تعديل 16 أبريل 201213 سنة بواسطة gold_heart تقديم بلاغ
بتاريخ: 16 أبريل 201213 سنة comment_223328 try write below code in WHEN-VALIDATE-RECORD trigger at block prices declare ln$count_exists number; begin select count(1) into ln$count_exists from prices where item_code = :prices.item_code and (:prices.date_from between date_from and date_to or :prices.date_to between date_from and date_to or (:prices.date_from < date_from and :prices.date_to > date_to) ) and (ROWID <> :prices.ROWID or :prices.ROWID is null); if ln$count_exists > 0 then message('Overlooping is existed'); edn if; end; تقديم بلاغ
بتاريخ: 19 أبريل 201213 سنة comment_223460 it is working تم تعديل 19 أبريل 201213 سنة بواسطة omogun تقديم بلاغ
بتاريخ: 19 أبريل 201213 سنة كاتب الموضوع comment_223462 اعتقد ان الكود صحيح لكن المشكله الان ان الفورمز لايمكن عمل run ابدا ولا يظهر خطا وحاولت حلول كثيره لم تفلح الصور من هنا http://i41.tinypic.com/hv2we0.jpg وايضا http://i40.tinypic.com/lyu6h.jpg الموضوع http://www.araboug.o...showtopic=49745 في انتظار الرد ... وشكرا تم تعديل 19 أبريل 201213 سنة بواسطة gold_heart تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.