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

Ora-01403: No Data Found

Featured Replies

بتاريخ:

عندما اقوم بتنفيذ هذا الكود :-

declare
type qq is table of employees.last_name%type index by pls_integer;
type ww is table of employees.department_id%type index by pls_integer;
tln qq;
tdid ww;
cursor yyy is select last_name,department_id from employees
where  salary<17000
and employee_id between 100 and 114;
o number:=0;
begin
for i in yyy loop
o:=o+1;
tln(o):=i.last_name;
tdid(o):=i.department_id;
end loop;
for t in tln.first||tdid.first..tln.last||tdid.last loop
dbms_output.put_line('Employee Name: ' ||tln(t)||' Department_id: '||tdid(t));
end loop;
end;
/



لماذا يعطينى هذا الخطأ :-

Employee Name: Popp Department_id: 100
Employee Name: Raphaely Department_id: 30
declare
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 17



مع العلم أنى اعمل على أسكيمة ال hr بأوراكل 10g
و أرجو الرد فى أسرع وقت .... وشكراً

بتاريخ:

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

أخي الكريم هاني

الخطأ بسبب عمل concat للindex الخاص بالtable of last_name مع الtable of depratment_id

فعمل الconcat سيبب وجود index غير موجود فعليا كما انه برغم ان عدد العناصر في الجدول 12
الا انه سيقوم بتنفيذ الloop عدد 1201 مرة بسبب الconcat فهو قد بدا من 11 الي 1212
و هو خطأ بالطبع
و انت عمليا لا تحتاج لعمل هذا الconcat
فيمكن تنفيذ ما تريد باستخدام الidex الخاص باي من الجدولين الموجودين لديك
و اليك نسخة مصححة من الكود

declare
type qq is table of employees.last_name%type index by binary_integer;
type ww is table of employees.department_id%type index by binary_integer;
tln qq;
tdid ww;
cursor yyy is select last_name,department_id from employees
where  salary<17000
and employee_id between 100 and 114;
o number:=0;
begin
for i in yyy loop
o:=o+1;
tln(o):=i.last_name;
tdid(o):=i.department_id;
end loop;
for t in tln.first..tln.last loop
dbms_output.put_line('Employee Name: ' ||tln(t)||' Department_id: '||tdid(t));
end loop;
end;
/


و الطريقة الأفضل و الأصح
هي استخدام نفس الloop الاول الخاص بالcursor في العرض بدون الحاجة الي الloop الثاني خاصة عند وجود الكثير من البيانات
و اليك التعديل

declare
type qq is table of employees.last_name%type index by binary_integer;
type ww is table of employees.department_id%type index by binary_integer;
tln qq;
tdid ww;
cursor yyy is select last_name,department_id from employees
where  salary<17000
and employee_id between 100 and 114;
o number:=0;
begin
for i in yyy loop
o:=o+1;
tln(o):=i.last_name;
tdid(o):=i.department_id;
dbms_output.put_line('Employee Name: ' ||tln(o)||' Department_id: '||tdid(o));
end loop;
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.