I have a PL/SQL table-type/associative-array in Oracle
CREATE OR REPLACE TYPE STRING_TBL IS TABLE OF VARCHAR2(3000);
on which I can perform select queries like this
...
strings STRING_TBL;
...
SELECT * FROM TABLE(strings);
But what is the column name of that one column in the result set? That is, what would I need to put into <name_of_only_column>
to make this query work:
SELECT rowid, p.<name_of_only_column>
FROM TABLE(strings) p;
Alternatively, if I can't do that, is there any way to alias that one column through a subselect in Oracle?
But what is the column name of that one column in the result set?
Pseudocolumn named column_value
.
-- nested table schema object type
create type t_list as table of number
select column_value
from table(T_List(1,2,3))
COLUMN_VALUE
------------
1
2
3
Note: In this case it's not allowed to use rowid
pseudocolumn, simply because in-memory nested table does not have one.
It's column_value
, the following should work:
SELECT rowid, p.column_value
FROM TABLE(strings) p;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With