display data type of an expression?

Moderator: NorbertKrupa

Post Reply
dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

display data type of an expression?

Post by dbmsuser7 » Tue Apr 08, 2014 3:12 pm

Is there any function for displaying the data type of an expression?

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: display data type of an expression?

Post by NorbertKrupa » Tue Apr 08, 2014 3:57 pm

Do you have an example? I'm not sure what you mean by expression (column, function, etc.)
Checkout vertica.tips for more Vertica resources.

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: display data type of an expression?

Post by dbmsuser7 » Tue Apr 08, 2014 4:28 pm

E.g.

Code: Select all

165323*(123456.7890123::NUMERIC(13,7))
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

Code: Select all

CREATE TABLE ... AS SELECT
statement, then do

Code: Select all

\d [i]table_name[/i]
Would be much easier to type

Code: Select all

SHOW_TYPE(165323*(123456.7890123::NUMERIC(13,7)))
if such a function existed.

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: display data type of an expression?

Post by NorbertKrupa » Tue Apr 08, 2014 4:48 pm

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.

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: display data type of an expression?

Post by dbmsuser7 » Tue Apr 08, 2014 6:59 pm

Thanks.

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: display data type of an expression?

Post by id10t » Fri Apr 11, 2014 8:52 pm

Hi!

[DELETED]
Last edited by id10t on Wed May 06, 2015 5:46 pm, edited 1 time in total.

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: display data type of an expression?

Post by dbmsuser7 » Mon Apr 14, 2014 6:54 pm

sKwa wrote:And how about function overloading?
Yeah, that seems like a handy trick. I'll try that soon.

Post Reply

Return to “Vertica SQL”