gold_heart بتاريخ: 16 أبريل 2012 تقديم بلاغ مشاركة بتاريخ: 16 أبريل 2012 (معدل) لمنع تداخل التواريخ في البلوك الفرعي عند الادخال 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 أبريل 2012 بواسطة gold_heart اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Mahmoud Ahmed El-Sayed بتاريخ: 16 أبريل 2012 تقديم بلاغ مشاركة بتاريخ: 16 أبريل 2012 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; 1 اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
omogun بتاريخ: 19 أبريل 2012 تقديم بلاغ مشاركة بتاريخ: 19 أبريل 2012 (معدل) it is working تم تعديل 19 أبريل 2012 بواسطة omogun اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
gold_heart بتاريخ: 19 أبريل 2012 كاتب الموضوع تقديم بلاغ مشاركة بتاريخ: 19 أبريل 2012 (معدل) اعتقد ان الكود صحيح لكن المشكله الان ان الفورمز لايمكن عمل run ابدا ولا يظهر خطا وحاولت حلول كثيره لم تفلح الصور من هنا http://i41.tinypic.com/hv2we0.jpg وايضا http://i40.tinypic.com/lyu6h.jpg الموضوع http://www.araboug.o...showtopic=49745 في انتظار الرد ... وشكرا تم تعديل 19 أبريل 2012 بواسطة gold_heart اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.