I have a type declared in my package spec
TYPE product_type IS RECORD (
product_id NUMBER,
Product_name VARCHAR2(50),
product_stat VARCHAR2(50),
product_type VARCHAR2(50),
product_uom NUMBER);
I have a function which returns this type in the package body
FUNCTION product_info_typ(p_att1 IN VARCHAR2,p_att2 IN VARCHAR2)
RETURN product_type IS
CURSOR c_prod IS
SELECT product_id,
Product_name,
product_stat,
product_type,
product_uom
FROM prod_table
WHERE attribute1 = p_att1
AND attribute2 = p_att2 ;
l_prod_typ product_type;
BEGIN
l_prod_typ := NULL;
OPEN c_prod ;
FETCH c_prod INTO l_prod_typ.product_id,
l_prod_typ.Product_name,
l_prod_typ.product_stat,
l_prod_typ.product_type,
l_prod_typ.product_uom ;
CLOSE c_prod ;
RETURN l_prod_typ;
END product_info_typ;
I want to call this function in a select query of a cursor. But it throws error ----- ORA-00902: invalid datatype.
Any ideas how to overcome this. What am I doing wrong?