بتاريخ: 18 يناير 200620 سنة comment_57897 Salam To Every One... i have this problem.. i have a form OKAY..and the user enters data But i want the form when the user enters an appointment that is allready exist.. to show a message that he CANT SAVE coz the appointment is exist.. and i have done this CODE that checks the date, the start_time & the end_time For the appointmentBUT.. it didnt work !!!!some times it work only when i make execute and then i try to save... but only in the first record !!!!oh..there is another thing.. the form when i press the save button it stop respoding !!!and this is the code.. i putt it in a button declare v_date appointment.app_date%type; v_time appointment.app_start_time%type; v_end appointment.app_end_time%type; cursor check_c is select app_date, app_start_time,app_end_time from appointment where emp_id = :appointment.emp_id; begin open check_c; loop fetch check_c into v_date,v_time,v_end; if :appointment.app_date=v_date then if to_char(:appointment.app_start_time,'hh:mi') = to_char(v_time ,'hh:mi') or to_char(:appointment.app_end_time,'hh:mi')=to_char(v_end,'hh:mi') or to_char(:appointment.app_start_time,'hh:mi') between to_char(v_time ,'hh:mi') and to_char(v_end,'hh:mi') or to_char(:appointment.app_end_time,'hh:mi') not between to_char(v_time ,'hh:mi') and to_char(v_end,'hh:mi') then if show_alert('ALl_CHECK')=ALERT_BUTTON1 then raise form_trigger_failure; end if; else commit; end if; end if; exit when check_c%found; end loop; close check_c; end; please MAY SOME ONE HELP !!!!! تقديم بلاغ
بتاريخ: 19 يناير 200620 سنة comment_57929 Where do u write this code ? and what is the datatypes of the starttime, endtime?but as a start naturally it will work for one record whice is the current u din't have loop here to check all records u do the check only for the current so it may work only one time it is better if u have validation to put it it in the WHEN-VALIDATE triggers item or record.if u don't use any restricted built ins بالتوفيق تقديم بلاغ
بتاريخ: 19 يناير 200620 سنة كاتب الموضوع comment_57956 أهليننوع الstart_time والEnd_time في الData Basa... من نوع dateلكني غيرته في الخصائص وحطيت الفورمات hh:miوكتبت هذا الكود في زر.. هذا الزر يعمل لي حفظ... يعني المستخدم يدخل البيانات ولمن يضغط على الزر يشتغل الكيرسير المهم .. تقول انه بس راح يشيك على ريكورد واحد !!!! بس ليه ؟؟؟؟عندك فكره للفاليدات ؟؟!!! تقديم بلاغ
بتاريخ: 20 يناير 200620 سنة comment_57992 الطريقة المثالية لعمل هذا و بشكل عام كالتالى1- قم بعمل الجدول الخاص بالتخزين و اعطة PK مناسب2- ادخل فى المنطقة Pre_Insert الكود الخاص بالتأكد من عدم وجود هذا الركورد من قبل و لكن لماذا فى ال Pre_Insert و الأجابة بأختصار انة عند العمل على واجه Multi User يمكن ادخال هذا البيان من اكتر من موظف و لهذا افضل مكان يمكن وضح الكود الخاص بالفحص هو Pre_Insert لأنك بهذا الشكل تتعامل بأجزاء من الثانية عند حفظ البيانات و لمزيد من المعلومات يمكنك الأتصال بى عن طريق الميل و شكراOracle ITself تم تعديل 20 يناير 200620 سنة بواسطة oracle_itself تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.