Ref cursor in stored proc
From: Tim Mickelson <tim_mickelson_at_hotmail.com>
Date: Tue, 14 Oct 2008 12:17:23 +0200
Message-ID: <Vk_Ik.31056$Uo5.22181@tornado.fastwebnet.it>
END TESTFUNCTION; Received on Tue Oct 14 2008 - 05:17:23 CDT
Date: Tue, 14 Oct 2008 12:17:23 +0200
Message-ID: <Vk_Ik.31056$Uo5.22181@tornado.fastwebnet.it>
Hello
If I call a function from a stored procedure and the function returns a ref cursor. The only info I have and want is that this ref cursor has a field, "NAME", but I know nothing of all other fields, how do I fetch this field name?
E.g. this does not work since the ref cursor has many values, not just NAME.
FUNCTION TESTFUNCTION(input_var IN VARCHAR2) RETURN VARCHAR2 IS
TYPE RecType IS RECORD(nome IMPRESA_PARIX.NAME%TYPE); Cursore IMP_REFCUR; rec RecType; BEGIN -- Call function that returns IMP_REFCUR (ref cursor) Cursore := SEARCH_PARAMETRICA('MKM S.R.L.'); LOOP FETCH Cursore INTO rec; DBMS_OUTPUT.PUT_LINE(rec.NAME); EXIT WHEN Cursore%NOTFOUND; END LOOP; RETURN NULL;
END TESTFUNCTION; Received on Tue Oct 14 2008 - 05:17:23 CDT