Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00932: inconsistent datatypes: expected - got -

420646Aug 12 2005 — edited Aug 12 2005
Hi,
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2005
Added on Aug 12 2005
4 comments
1,127 views