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

مطلوب شرح وافي موضوعي >>> استخدام Bulk و For All

Featured Replies

بتاريخ:

 

استخدام bulk collect  و for all  بلا شك هام للغاية عند التعامل مع الكميات الضخمة من البيانات 

ونرجو ممن لدية خلفية جيدة تناول الموضوع بالشرح ولكم جزيل الشكر 


CREATE OR REPLACE PROCEDURE increase_salary (
department_id_in IN employees.department_id%TYPE,
increase_pct_in IN NUMBER)
IS
TYPE employee_ids_t IS TABLE OF employees.employee_id%TYPE
INDEX BY PLS_INTEGER;
l_employee_ids employee_ids_t;
l_eligible_ids employee_ids_t;

l_eligible BOOLEAN;
BEGIN
SELECT employee_id
BULK COLLECT INTO l_employee_ids
FROM employees
WHERE department_id = increase_salary.department_id_in;

FOR indx IN 1 .. l_employee_ids.COUNT
LOOP
check_eligibility (l_employee_ids (indx),
increase_pct_in,
l_eligible);

IF l_eligible
THEN
l_eligible_ids (l_eligible_ids.COUNT + 1) :=
l_employee_ids (indx);
END IF;
END LOOP;

FORALL indx IN 1 .. l_eligible_ids.COUNT
UPDATE employees emp
SET emp.salary =
emp.salary
+ emp.salary * increase_salary.increase_pct_in
WHERE emp.employee_id = l_eligible_ids (indx);
END increase_salary;

 

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

مفيش حد استخدمها ؟؟؟؟

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

باختصار همايوفران الوقت والكود كثرا

لو تريد وضع بيانات 100 موظف فى جدول تعريفى

TYPE employee_ids_t IS TABLE OF employees.employee_id%TYPE

اما ان تعمل لوب على الاندكس له مثلا الموظف رقم 1 هو كذا والثانى هو كذا والثالث هو كذا باستخدام كرسور

قامت اوراكل باختصار الوقت والمجهود معا بتعريفهم هم ال 100 معا مرة واحدة وتلقائيا كل موظف ياخذ الاندكس الخاص به

بتاريخ:

السلام عليكم و رحمة الله :

استخدام BULK او forall  مهم جدا  ولا أنصح باستخدامها الا في حاله استخدام ORACLE COMPLEX TYPE فقط  و لغير هذا فان CURSOR يفي بالغرض و بزياده  و يجب ان  تأخذ ف الحسبان ..

و تستخدم في حاله تمرير جدول كمتغير و ما سيرجع غير معرف نوعه ..sys_ref  و

لا تستخدمها في الجدوال real time commit  او الجداول التي تحتوي علي الانواع blob , clob,table cloumn 

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

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

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

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

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

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.