الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ما الخطا في هذا البلوك

مغلق
بدأه gareb في 24 مايو 2007 · 2 رد · 1,538 مشاهدة · في قسم لغةالاجرائات Pl/sql
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ..

اريد معرفة الخطاء عند تنفيض هذا الابلوك ,,,

set serveroutput on format wrap size 1000000
ACCEPT courseID PROMPT 'Enter the course ID to dispaly all student Registed :   '
DECLARE 
cursor registry_cursor is select student_ID from REGISTRED_TABLE where REGISTRED_TABLE.LECTURE_ID = LECTURE_TABLE.LECTURE_ID and LECTURE_TABLE.COURSE_ID = courseID;
  profVal registry_cursor%ROWTYPE;

BEGIN
  open registry_cursor;
  dbms_output.put_line('The Student name is : ');
  LOOP
	fetch registry_cursor into profVal;

	select first_name , last_name from Student_table where profVal.student_ID;

	END LOOP;

END;
/
#2

من غير إختبار للبلوك

انت قمت بعمل حلقة بدون أن تبين متى تتوقف هذه الحلقة ؟؟

  LOOP
	fetch registry_cursor into profVal;

	select first_name , last_name from Student_table where profVal.student_ID;

	END LOOP;

يجب عليك تحديد ذلك

LOOP
exit when registry_cursor%notfound;
	fetch registry_cursor into profVal;

	select first_name , last_name from Student_table where profVal.student_ID;

	END LOOP;
close registry_cursor;

وأفضل أيضاً إغلاق المؤشر بالنهاية كما وضحت :

close registry_cursor;

#3
سلمت.gif
7cb0aa6f8b.gif

هذا الموضوع مغلق.

مواضيع مشابهة