Converting from a V_String to a double INDB
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Labels:
- Connectors
- Database Connection
- In Database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 , )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
