الانتقال إلى المحتوى
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.

calling function

Featured Replies

بتاريخ:

ORA-06550: line 82, column 71: PLS-00302: component 'GET_ERROR' must be declared

لدينا package  بها  2  function   

لما استدعى ال function  الثانية تظهر المشكلة

لانى جربتها فى مصال بسيط تأكدت انه ينفذ الدالة الاولى ويعطى رسالة الخطأ السابقة عند استدعاء الدالة الثانية

create or replace package "ERROR_HANDLING_PKG" as
  
    -- تعريف الدالة handle_error
    FUNCTION handle_error(p_error IN apex_error.t_error) 
    RETURN apex_error.t_error_result;

      -- تعريف الدالة get_error
    FUNCTION get_error(p_error IN apex_error.t_error) 
    RETURN apex_error.t_error_result;

end "ERROR_HANDLING_PKG";

بتاريخ:

بتستدعيها ازاي؟ 

وهل ليها Body؟

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

شكرا لك

EXCEPTION
    WHEN OTHERS THEN
        DECLARE
            l_error_result apex_error.t_error_result;
        BEGIN
            l_error_result := error_handling_pkg.get_error(apex_error.get_error);
            -- عرض الرسالة للمستخدم
            apex_error.add_error(p_message => l_error_result.message);
           --null;
                
        END;

 

 

create or replace package body "ERROR_HANDLING_PKG" as
     
 
    FUNCTION handle_error(p_error IN apex_error.t_error) 
    RETURN apex_error.t_error_result IS
        l_result apex_error.t_error_result;
    BEGIN
        l_result := apex_error.init_error_result(p_error => p_error);

        -- إضافة رقم الخطأ والرسالة إلى النتيجة
        l_result.message := 'Error Code: ' || p_error.ora_sqlcode || ' - ' || p_error.message;

        -- تخصيص الرسالة بناءً على نوع الخطأ
        IF p_error.is_internal_error THEN
            l_result.message := 'An unexpected internal application error has occurred. Please contact support.';
        END IF;

        -- إرجاع النتيجة
        RETURN l_result;
    END handle_error;

FUNCTION get_error(p_error IN apex_error.t_error) 
    RETURN apex_error.t_error_result IS
        l_result apex_error.t_error_result;
    BEGIN
        -- استدعاء دالة handle_error لمعالجة الخطأ
        l_result := handle_error(p_error);
        
        -- يمكنك إضافة المزيد من المنطق هنا إذا لزم الأمر

        RETURN l_result;
    END get_error;

end "ERROR_HANDLING_PKG";

  • بعد 2 شهور...
بتاريخ:

get_error الي مش شايفها هي apex_error.get_error مش الفانكشن بتاعتك الي بنفس الإسم.

المشكلة في الباراميتر. هو منتظر باراميتر من نوع apex_error.t_error.

جرب الآتي:

DECLARE
    x              apex_error.t_error;
BEGIN
    l_error_result := error_handling_pkg.get_error(x);
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.