Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get DataType from a column?

Blue BirdApr 25 2018 — edited Apr 25 2018

I would like to know if maybe exist some kind of Oracle built in function which return Data type from returned columns?

For example for below query I would like get back something in form: Number, Text (or VarChar2), Date, etc.

Select 1, 'Text', SysDate

From Dual;

which I would call this way:

Select DataTypeFx(1), DataTypeFx('Text'), DataTypeFx(SysDate)

From Dual;

Sometimes is not obvious if you get back for example Text or Date value, so that way it could be easier to find out.

BB

This post has been answered by BrunoVroman on Apr 25 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2018
Added on Apr 25 2018
17 comments
20,782 views