Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Function to get a UDT value's type in a query

User_1871Jun 20 2022

It would be helpful if there were a function that could get a UDT value's type in a query:
Testing a UDT in Oracle Live SQL: Describe a query's column datatype without creating a view
----------------------------------------------------------------------------------------------------
I'm aware that there is a workaround where we can create a view from a query, and then look at user_tab_columns to see the datatype:

select data_type
from user_tab_columns
where table_name = 'MY_ST_GEOMETRY_VW';

Result:

DATA_TYPE
--------------
MY_ST_GEOMETRY

That works, but it would be nice if there were a more convenient way to determine the datatype of a UDT value in a query. A DataType() function might be ideal.

Comments
Post Details
Added on Jun 20 2022
3 comments
434 views