Hi Amitpatel
thanks for replying . here is my procedure pls. go through it and say if its looking okay.
create procedure findstudents(teacheridin varchar2) is
stud_id_First varchar2(150);
stud_id_Cursor varchar2(150);
stud_id_insert varchar2(150);
cursor c1
is
Select userid into stud_id_First from studentclasstable
where classid in (Select classid from teacherclass where
teacherid = teacheridin);
begin
open c1;
loop
fetch c1 into stud_id_cursor;
insert into temptable values(stud_id_cursor);
if teacheridin <> stud_id_cursor then
--exit when c1%notfound;
select userid into stud_id_insert from
studentclasstable
where classid in (select classid from teacherclass
where teacherid = stud_id_cursor);
insert into temptable values(stud_id_insert);
end if;
end loop;
close c1;
end;
thanks
J
Thanks
Quote:
Originally Posted by amitpatel66
You have your requirement in place. Start writing a procedure which would give you desired information.
Let us know in case of any difficulty writing a procedure.
You also know that the input parameter to the procedure would be <teachers name>
1. your first step would be to get all the students under a particular teacher.
2. Your second step would be to loop through all the students and get the list of their students.
3. Now put all the students together and return the distinct values.
Do POST back what you have tried to achieve this?
We will help you in case of any issues!!