oracle - PL/SQL - cannot access rows from a non-nested table item -


I am trying to get all the column names of my_table , and make it For example, my_table "year" , "month" , my_fn > "Day" . Get this column name using the all_tab_cols table, and store it in the tmp collection using the For-loop, I use my_fn Make these column names "month, year, day" Currently, I'm getting the following error.

Error log - this is what I am getting as an error

  SQL error: ORA-2295: non -Nested table item can not reach rows from 22905. 00000 - "Can not access rows from non-nested table items" * Reason: Attempt to access rows of items whose type is not known at parse time or * Works of nested table type: Item nested table type Use CAST to enter   

SQL code - this is my code. Type

  or replace the cola_re as the table of varchar2 (1000); Change / create or change function I_FN (in input VARCHAR2, input 2 in VARCHAR2, input 3 in VARCHAR2) back varchar2 AS tmp col_array; Texty varchar2 (1000); Start from select_stab_cols in collect_column_multiple where owner = 'me' and table_name = 'my_table'; For i 1..tmp.count in loop txt: = txt || To_char (tmp (i)) || ','; End loop; // txt: = 'wow'; Return txt; END my_fn; From / select * tab (my_fn ('', '', ''));   

I have tried the following simple code, but still not working, I might need more knowledge about using the CAST function: (

  BEGIN txt: = 'wow'; // or txt: = CAST (as 'wow' varchar2); Returns txt;   

Thank you very much for your help

Your function returns a string is not a collection. To get the value you

  SELECT my_fn ('', '', '') from dual;   

.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -