الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

مامعنى exception وكيفية استخدامها

Featured Replies

بتاريخ:

متى استخدم ال pragma
وما الفرق بينها وبين
raise_application_error
مع مثال

بتاريخ:

السلام عليكم
pragma exception_init
تستخدم لوضع نص لoracle exception
و التي لها رقم و لكن ليس لها نص
فهناك ثلاثة انواع من الexceptions
1-predifined exception like ora-01403 no data found
2- nonpredifined exception
like ORA-2292
و هو الخاص ب
integrity constraints
child record found
3-user defined exception
و هي اكسبشنز خاصة بالبروجرامر و ليست أخطاء في اداتا بيز
اي ممكن ان تنتج عن أخطاء ف ي البيزنس مثلا
pragma exception_initو ال
تستخدم لوضع إسم للنوع الثاني من الexceptions
حتي تسطيع التعامل معه في قسم exception
in ur block
اي تستطيع الاشارة إليه مثل
when no_data_found then
do actions here ;

اما
raise application_error فهي مجرد بروسيدر تستخدم في ال
triggers and stored procedures لعمل رسالة و إظهارها لليوزر في الابلكيشن
بالضبط مثل message built in في الفورم
و لا تستعمل لاي exception
هي فقط لعمل رسالة
و تظهر عندما يحدث خطا معين في الانسرت مثلا
و يقوم اليوزر ب عمل display error
و هذه مثال جاهز لل pragma exception_init

PROCEDURE delete_company (company_id_in IN NUMBER)
IS
  /* Declare the exception. */
  still_have_employees EXCEPTION;

  /* Associate the exception name with an error number. */
  PRAGMA EXCEPTION_INIT (still_have_employees, -2292);
BEGIN
  /* Try to delete the company. */
  DELETE FROM company 
   WHERE company_id = company_id_in;
EXCEPTION
  /* If child records were found, this exception is raised! */
  WHEN still_have_employees
  THEN
     DBMS_OUTPUT.PUT_LINE
        (' Please delete employees for company first.');
END;



WHEN still_have_employees
  THEN
     DBMS_OUTPUT.PUT_LINE
        (' Please delete employees for company first.');
END;


و يمكنك في الجزء السابق استعمال raise_application_error
حتي يظهر الخطا علي الابلكيشن
هكذا

WHEN still_have_employees
  THEN
 RAISE_APPLICATION_ERROR (-20121,'Please delete employees for company first.');
END;


أتمني ان تكون استفدت
بالتوفيق

بتاريخ:
  • كاتب الموضوع

اجابة سريعة واستفادة كبيرة وشكر وفير

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.