I have no experience with db, but I'm trying to get the column names from the result of the stored procedure.
The code must be shared because the stored procedure is unknown. The first step is to make it work for procedures without input parameters (io_cursor only)
My code so far:
procedure fakeProc ( io_cursor in out t_ref_cursor )
And the code that I use:
PROCEDURE get_SQL_Fields ( out_result out varchar2) as v_cur NUMBER := NULL; v_count NUMBER := NULL; v_tab_desc DBMS_SQL.DESC_TAB; sqlstr VARCHAR2(100); BEGIN v_cur := DBMS_SQL.OPEN_CURSOR; --Here i get errors sqlstr :='begin '|| fakeproc()||';end;'; DBMS_SQL.PARSE(v_cur, sqlstr, DBMS_SQL.NATIVE); DBMS_SQL.DESCRIBE_COLUMNS(v_cur, v_count, v_tab_desc); FOR i IN 1..v_count LOOP out_result := out_result||v_tab_desc(i).COL_NAME||','; END LOOP; end if; END get_SQL_Fields;
So my problem is to build this sqlstr; The error I get is: Error: PLS-00306: The wrong number or types of arguments when called on FAKEPROC. Line: 654 Text: sqlstr: = 'begin' || fakeproc () || '; end;';
Error: PL / SQL: expression ignored Line: 654 Text: sqlstr: = 'begin' || fakeproc () || '; end;';
source share