troubleshooting Question

Oracle 9i compile error PLS-00382: expression is of wrong type

Avatar of Al
Al asked on
Oracle Database
14 Comments1 Solution4353 ViewsLast Modified:
The following procedure worked fine all along.  When Oracle 9i was installed,
I suddently get compile error:  PLS-00382: expression is of wrong type
See line with arrow.   What's the solution to this problem?
Please help.
Thanks.
Alad
PLS-00382: expression is of wrong type
FUNCTION f_cov_count(covcode IN VARCHAR2,SEGMENT IN VARCHAR2)RETURN cursorType
IS
ref_cur cursorType;
res BOOLEAN:=FALSE;
ncount NUMBER;
BEGIN

    IF ref_cur%isopen THEN
         CLOSE ref_cur;
    END IF;

    SELECT COUNT(*) INTO ncount FROM simdata.L_SEGMENT
    WHERE coverage_code = covcode AND segment_number=SEGMENT;

    IF ncount > 0 THEN
        res:=TRUE;
    ELSE
        res:=FALSE;
    END IF;

    OPEN ref_cur FOR SELECT res AS res FROM dual;   //<-- I get error here.  What's the solution to this problem?

    RETURN ref_cur;
END;
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros