Hi Everyone
Im trying to convert a V_String column to a double indb.
Anyway I can do this other than Streaming out, Changing the data type in select and Streaming in (current process)
Hope there is an easier way to this because the streaming increases the run time significantly.
Regards
Keith
You want to change the data type of a String field in the SQL Query? If Oracle, you can do to_number.
https://www.techonthenet.com/oracle/functions/to_number.php
If the string has non-numeric characters, you'd need to strip them first (i.e. $ or , )
this varies based upon your underlying db - usually it's a CAST function - or TRY CAST - but specific syntax varies. It also matters if you are going to do this for an existing column (where you can use a formula in-db tool) or in your query (which you can hard code in SQL).
Hello @Kei
You can use cast function such as https://www.w3schools.com/sql/func_mysql_cast.asp
CAST(yourfield AS double)
in a formula in-db.
Pleas note that v_string is an alteryx type, not an sql one.
Best regards,
Simon