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

تابع ملا حظات لمبرمجي اوراكل

Featured Replies

بتاريخ:

3 - انتيه للدالة to_char
لاحظ المثال التالي


  SQL> set serveroutput on
    SQL> declare
      2      dob_month number(2) := 6;
      3      dob_day   number(2) := 6;
      4      dob_year  number(4) := 1960;
      5      --
      6      hold_dob  varchar2(8) := '06061960';
      7  begin
      8      if to_char (dob_month,  '09') = substr (hold_dob, 1, 2) and
      9         to_char (dob_day,    '09') = substr (hold_dob, 3, 2) and
     10         to_char (dob_year, '9999') = substr (hold_dob, 5, 4) then
     11             dbms_output.put_line ('Y');
     12      else
     13          dbms_output.put_line ('N');
     14      end if;
     15      --
     16      if dob_month = to_number (substr (hold_dob, 1, 2), '99')   and
     17         dob_day   = to_number (substr (hold_dob, 3, 2), '99')   and
     18         dob_year  = to_number (substr (hold_dob, 5, 4), '9999') then
     19             dbms_output.put_line ('Y');
     20      else
     21          dbms_output.put_line ('N');
     22      end if;
     23  end;
     24  .
    SQL> /
    N
    Y

    PL/SQL procedure successfully completed.

    SQL>






و السبب ان الشرط الاول اعطى النتيجة n لان الدالة to_char تضيف فراغ space للارقام الموجبة
فمثلا ('To_char (6, '09 تعطي النتيجة "09 " . لاحظ زيادة الفراغ في البداية .وبالتالي كانت نتيجة الشرط false

بتاريخ:

شكرا أخى سالم على معلوماتك .... جزاك الله خير

بتاريخ:

مشكور يا أستاذ سالم وأن شاء الله تكون أمورك طيبه



بالتوفيق إن شاء الله

تم تعديل بواسطة aljebli

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

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

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

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

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

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.