Need help returning TABLE from Oracle function

From: Bryan Ax <bax_at_kleinbuendel.com>
Date: Mon, 30 Mar 2009 13:12:06 -0700 (PDT)
Message-ID: <ff3b605e-9f5a-4f1d-a7f5-5c8132265768_at_l10g2000vba.googlegroups.com>



I have the following Oracle function from a vendor:

CREATE OR REPLACE
FUNCTION test_warn3

RETURN VARCHAR2 IS ERRORS ab_curs.error_list;
startdate DATE := to_date('01-JAN-2009','DD-MON-YYYY'); enddate DATE := to_date('31-JAN-2009','DD-MON-YYYY'); histdate DATE := TRUNC(SYSDATE);

BEGIN update_package1.update_query(errors,

                               startdate,
                               enddate,
                               histdate);

RETURN('Test Warn 3 Complete');

END; -- END FUNCTION test_warn3
/

However, what I really want to do is return ERRORS, NOT just the message 'Test Warn 3 Complete', and then take the results of errors and do some logic in C#. However, I haven't been able to get this to work - I've tried having an OUT param that's a REF CURSOR and doing:

OPEN errorCursor FOR SELECT * FROM ERRORS, but I get an error when I try to run that because the compiler doesn't recognize ERRORS as a table in the database - it isn't. It's just a TABLE return type.

Any help appreciated,

Bryan Received on Mon Mar 30 2009 - 15:12:06 CDT

Original text of this message