Skip to main content
Question

How can we find out the datatype of column.

  • June 20, 2023
  • 6 replies
  • 74 views

We are using File upload data connection.

 

I forget the datatype of column, so can anyone help in writing query like how I can find the datatype of column.

6 replies

Forum|alt.badge.img+12

Hey,

you can use in the Transformation the following query (here the link to the Vertica SQL documentation) to select the Data Type, Table Name and Column Name of the table inserted in the WHERE clause:

 

SELECT DATA_TYPE, TABLE_NAME, COLUMN_NAME FROM COLUMNS WHERE TABLE_NAME = '<table_name>'

 

Regards,

Alberto

 


  • Author
  • Level 2
  • June 20, 2023

Suppose, If I want to change the datatype of a columns of a file that I uploaded using upload file data connection.

 

Then what query I need to use.


Forum|alt.badge.img+12

Suppose, If I want to change the datatype of a columns of a file that I uploaded using upload file data connection.

 

Then what query I need to use.

Unfortunately, you can't modify directly in the Configuration Process during the File Uploading. Another way to change the data type of a column is to use the CAST Function in SQL Vertica (here the documentation).

For example, here an example to change the DataType of a column from char to integer:

 

SELECT CAST(TABLE.COLUMN1 AS INT) FROM TABLE

 

Another way is to use the PQL Function to change the Data Type directly on the Dashboard.

 

Best Regards,

Alberto


  • Author
  • Level 2
  • June 20, 2023

Thanks Alberto for your help.😊


kailash.potha12
Level 10
Forum|alt.badge.img+6

Suppose, If I want to change the datatype of a columns of a file that I uploaded using upload file data connection.

 

Then what query I need to use.

Hi @utkarsh.na 

 

You can try this option if you are sure about your data.

Click on 3 dots - > Configure Data Schema -> Click on Next which will give you an option to select data type image 


  • Level 1
  • September 9, 2024

Unfortunately, you can't modify directly in the Configuration Process during the File Uploading. Another way to change the data type of a column is to use the CAST Function in SQL Vertica (here the documentation).

For example, here an example to change the DataType of a column from char to integer:

 

SELECT CAST(TABLE.COLUMN1 AS INT) FROM TABLE

 

Another way is to use the PQL Function to change the Data Type directly on the Dashboard.

 

Best Regards,

Alberto

Hi, for some reason it is not working for me? I have a column called sorting which I brought in as string. I need to covert the column and all the values in it back to int.