how to find data type of each record in table
in postgres, "select pg_typeof(columnA for example) from tableName" returns each record's "data type" of column "columnA" in table "tableName". how to do this in vertica database?
"select data_type from columns where table_name = " is not the one I am looking.
0
Answers
Maybe something like this?
Thank you Jim very much. Unfortunately, it is not what I asked. In vertica, columns table has definition of table & columns. "select data_type, column_name from columns where table_name = 'xyz'" returns column name and its defined data type of 'xyz' table. What I need is, to know the data type of each record in 'xyz' table. something like, select columnA, pg_typeof(columnA) from xyz. In this query, pg_typeof() is predefined function of postgres. Is there similar / same function (as pg_typeof()) in vertica?
Hi,
So the table's column has to be a VARCHAR if it's going to contain data that can be coerced to different data types.
Maybe creating a function like this is what you need?