Hi,

I am having a problem in sorting the table type object using pl/sql.

I am trying to copy the contents of a table into another table after performing a sort.

create TYPE SEARCH_PARAMS AS OBJECT
(
dep_date date,
destination varchar2(30)
)
/
create TYPE SEARCH_CRITERIA AS TABLE OF SEARCH_PARAMS
/
CREATE OR REPLACE PROCEDURE TEST(
IN_SEARCHDATA IN SEARCH_CRITERIA) AS
SEARCHDATA SEARCH_CRITERIA := SEARCH_CRITERIA();
begin
SELECT new.dep_date dep_date,
new.destination destination
bulk collect INTO searchdata
FROM TABLE(CAST(in_searchdata AS SEARCH_CRITERIA)) AS new
order by new.dep_date
end;
--
The above procedure creation fails with
PLS-00385: type mismatch found at 'SEARCHDATA' in SELECT...INTO statement
--
I am not sure of the actual problem here. Can some one help me here?

Thanks
Raj