Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help required in procedure

Status
Not open for further replies.

arkr

Programmer
Feb 7, 2005
1
0
0
IN
hello here is my procedure

create or replace procedure proc_merit
is

v_fsc degrees.degree_id%type;
v_matric degrees.degree_id%type;
v_bsc degrees.degree_id%type;

cursor merit_cursor is
select applicant.application_no, applicant.First_name || ' ' || applicant.Last_name as name,

degree_result.degree_id, degree_result.obltained_marks, applicant.test_marks
from applicant, degree_result, degrees
where applicant.application_no = degree_result.applicaion_no
and (degree_result.degree_id = 'FSC' or degree_result.degree_id =
'Matric' or degree_result.degree_id = 'BSC');


begin
for merit_record in merit_cursor loop

if merit_record.degree_id = 'Matric' then
v_matric := merit_record.obltained_marks;

elsif merit_record.degree_id = 'FSC' then
v_fsc := merit_record.obltained_marks;

elsif merit_record.degree_id = 'BSC' then
v_bsc := merit_record.obltained_marks;

insert into merit_list values(merit_record.application_no,

merit_record.Name, merit_record.father_name, v_matric, v_fsc, v_bsc,
10*(v_matric/850) + 50*(v_fsc/1100) + 40*(merit_record.test_marks/100));

end if;


end loop;
commit;

end proc_merit;

well wen i compile it says
21/3 PL/SQL: SQL Statement ignored
21/46 PLS-00302: component 'APPLICATION_NO' must be declared

any comments?
 
I see nothing wrog with your procedure except in the following line of cursor declaration (maybe, you have to check the column name);
-------------------
where applicant.application_no = degree_result.applicaion_no


See ==> degree_result.applicaion_no
 
Also (a bit nit-picky) but why is degrees in the FROM statement for merit_cursor - it isn't selected from or used in any WHERE statement ?

Code a bit hard to read aswell, try using table aliases !!

Otherwise, as pointed out before, your column name probably doesn't exist in the table therefore it cannot be found - don't expect the same error reporting as you get in SQL*Plus!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top