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

بتاريخ:

[/move]الفواتير الساقطة من السريل [move]
برجاء الافادة فى هذا الموضوع الهام بنسبة لى او لكل المرجعين اريد عمل تقرير يوضح لى ارقام الفواتير الساقطة من السيريل بمعنى ازي كانت اول فاتورة تبداء برقم 100
و اخر فاتورة تم ادخلها مثلا 110
و تم ادخال الفاتورة 100 و 101 و 102 و 103 و 107 و 108 و 110

اريد تقرير يوضح لى الفواتير الساقطة من السريل وهى فى المثال السابق
104 و 105 و 106 و 109
برجاء الفادة الهامة فى هذا الموضوع
ولكم جزيل الشكر

بسم الله الرحمن الرحيم

بتاريخ:

أخي العزيز لقد قمت بوضع مشاركة حول هذا الموضوع في منتدى SQL بعنوان إيجاد أصغر رقم فارغ وإذا لم يجد يتم إحضار (أكبر رقم موجود + 1) وفي جميع الأحوال حل هذا الموضوع كما يلي :
الطريقة الأولى :

select count(EMP_NO) into count_no from EMPLOYEES;
if count_no = 0 then
l_id := 1;
else
select max(EMP_NO) into max_no from EMPLOYEES;
if count_no = max_no then
l_id := max_no + 1;
else
for row in (select EMP_NO from EMPLOYEES order by EMP_NO) loop
if l_id is null then
l_id :=row.EMP_NO ;
else
l_id := l_id + 1;
end if;
exit when l_id !=row.EMP_NO ;
end loop;
end if;
end if;
Message('tHE MINIMUM EMPTY NUMBER IS ='||l_id); 
هذه الطرقة معقدة قليلا ولكن يمكن الاستفادة منها لفهم بعض الأوامر المهمة وفيما يلي طريقة أسهل .

الطريقة الثانية :
declare
cursor c is select EMP_NO from EMPLOYEES order by EMP_NO;
v number(2);
i number(2):=0;
begin open c;
loop
fetch c into v; i:=i+1;
exit when i<>v or c%notfound;
end loop;
Message('tHE MINIMUM EMPTY NUMBER IS ='||I);
end;

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

لقد شاهت هذا الكود و استخدمتة با الفعل جزاك اللة كل خير لكن انا اريد انا اعرف كل الفواتير الساقطة مرة واحدة وليس اول فاتورة (تقرير يظهر لى فاتورة رقم 104 و 105 و 106 و 109 ) مرة واحدة شكرا اخى للتعاون معى

بتاريخ:

Dear Mr.Tamer:
The procedure steps is as follow:
1-Get minimum and maximum serial number of invoices.
2-Loop for all invoices and check for existance.
3-Output non existance invoice.
I will assume your table name is invoices with invoiceno as primary key.


declare
mn_ser number;--minimum serial
mx_ser number;--maximum serial
flag number(1);
begin
for i in mn_ser..mx_ser--loop for each serial
loop
select count(1)
into flag
from invoices
where invoiceno=i;
if flag=0 then --not exist(Missing)
dbms_output.put_line(i);
end if;
end loop;
end;
  • بعد 2 أسابيع...
بتاريخ:
  • كاتب الموضوع

شكرا على الاهتمام

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

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

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

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

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

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.