ERROR MESSAGE PLS-00382 - expression is of wrong type
774561Jun 1 2010 — edited Jun 1 2010I have read similar posting on the web. I have tried it all but I am still getting the error message. Kindly note planner_id was defined as a varchar2 when the table was created.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
SEE SPECIFICATION BELOW
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type labour_rec is RECORD
(
labour_cell VARCHAR2(300));
Type cur_labour is REF CURSOR RETURN labour_rec;
FUNCTION labour_record (l_planner_id in rcl.copq_raw_labour.planner_id%type) return cur_labour;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SEE BODY BELOW
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FUNCTION labour_record (l_planner_id in rcl.copq_raw_labour.planner_id%type) return cur_labour IS
my_cur_labour cur_labour;
BEGIN
OPEN my_cur_labour FOR
select c1.transaction_date, c1.workorder, c1.seq_no, c1.resource_id, c1.warehouse_id, c1.planner_id, c1.employee_id, c1.hours_worked
from copq_raw_labour c1
where c1.planner_id = l_planner_id;
close my_cur_labour;
--return my_cur_labour;
end labour_record;