pl/sql learner [message #250938] |
Wed, 11 July 2007 22:28 |
Neeharika
Messages: 6 Registered: July 2007 Location: JAPAN
|
Junior Member |
|
|
Hi All,
i created function and i want to call inpl/sql am getting error.plz help me.
create or replace function classinfo(p_department classes.deparartment%type,
p_course classes.course%type)return varchar2 is
v_current_students number;
v_max_students number;
v_fullpercent number;
begin
select current_students,max_students into v_current_students,v_max_students from
classes
where deparartment=p_department
and course=p_course;
v_fullpercent:=v_current_students/v_max_students*100;
if v_fullpercent=80 then
return 'full';
else
return'empty';
end if;
end classinfo;
cll in pl/sql
SQL> declare
2 cursor c_class is select deparartment,course from classes
3 ;
4 begin
5 for v_class in c_class loop
6 if classinfo(v_class.deparartment,v_class.course) then
7 dbms_output.put_line('full');
8 else
9 dbms_output.put_line('not full');
10 end if;
11 end loop;
12 end;
13 /
if classinfo(v_class.deparartment,v_class.course) then
*
ERROR at line 6:
ORA-06550: line 6, column 4:
PLS-00382: expression is of wrong type
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
|
|
|
|
|
|
|
|