phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eli Levine <>
Subject Re: Convert VARCHAR to INT
Date Thu, 22 Jan 2015 23:14:56 GMT
Phoenix stores VARCHAR and INTEGER values differently so your best bet is
to create a new INTEGER column and write a script to move data from the
VARCHAR column into the INTEGER column. If you are guaranteed that all data
in your VARCHAR column are indeed numbers you can do this with a single
SELECT UPSERT command using the TO_NUMBER built-in function. This is
assuming that the columns are non-PK columns.

On Thu, Jan 22, 2015 at 9:01 AM, Imran Mohammed <>

> Is it possible to convert a VARCHAR to int in phoenix ? If yes, can you
> please help me out with the way to do it.
> Regards,
> Imran A Mohammed.

View raw message