display data type of an expression?
Moderator: NorbertKrupa
display data type of an expression?
Is there any function for displaying the data type of an expression?
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: display data type of an expression?
Do you have an example? I'm not sure what you mean by expression (column, function, etc.)
Checkout vertica.tips for more Vertica resources.
Re: display data type of an expression?
E.g. the only way I can see to figure out whether this is a NUMERIC or a FLOAT is to create a table by putting this into a statement, then do
Would be much easier to type if such a function existed.
Code: Select all
165323*(123456.7890123::NUMERIC(13,7))
Code: Select all
CREATE TABLE ... AS SELECT
Code: Select all
\d [i]table_name[/i]
Code: Select all
SHOW_TYPE(165323*(123456.7890123::NUMERIC(13,7)))
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: display data type of an expression?
Ah. I know SQL Server has the SQL_VARIANT_PROPERTY, but I'm unaware of one for Vertica. It would definitely be a nice function to have.
Checkout vertica.tips for more Vertica resources.
Re: display data type of an expression?
Hi!
[DELETED]
[DELETED]
Last edited by id10t on Wed May 06, 2015 5:46 pm, edited 1 time in total.
Re: display data type of an expression?
Yeah, that seems like a handy trick. I'll try that soon.sKwa wrote:And how about function overloading?