ORA-00932: inconsistent datatypes: expected - got -
420646Aug 12 2005 — edited Aug 12 2005Hi,
I'm trying to create a view on the output of a function. When I try to select from the view I get the following error
ORA-00932: inconsistent datatypes: expected - got -
Here is the code
create or replace type loadProfileType as object
( HV NUMBER,
BG NUMBER,
EX NUMBER,
GPX NUMBER,
PERCENT_TOTAL NUMBER );
create or replace type loadProfileArray as table of loadProfileType;
CREATE OR REPLACE FUNCTION Get_Load_Profile2 RETURN loadProfileArray
IS
l_data loadProfileArray := loadProfileArray();
BEGIN
EXECUTE IMMEDIATE 'SELECT 1,2,3,4,5 FROM DUAL'
BULK COLLECT INTO l_data;
return l_data;
END;
CREATE OR REPLACE VIEW temp_load_profile AS
SELECT *
FROM Table(Cast(Get_Load_Profile2() As loadProfileArray));
select * from temp_load_profile;
SQL> SELECT *
2 FROM Table(Cast(Get_Load_Profile2() As loadProfileArray));
FROM Table(Cast(Get_Load_Profile2() As loadProfileArray))
*
ERROR at line 2:
ORA-00932: inconsistent datatypes: expected - got -
Has anyone got any ideas?