Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

erro in cast array

hi, if I exec this query :
SELECT STRING_TO_ARRAY('[95.717,95.718,95.717,95.717,95.717]',',')::ARRAY [float]
I get this error :
SQL Error [3376] [VX001]: [Vertica]VJDBC ERROR: Failed to find conversion function from varchar[] to float[]

Tagged:

Best Answers

  • moshegmosheg Employee
    edited December 2020 Accepted Answer

    I've tried the following syntax on Vertica 10.x and it works.

    SELECT STRING_TO_ARRAY('[95.717,95.718,95.717,95.717,95.717]', ',');
                    STRING_TO_ARRAY
    ------------------------------------------------
     ["95.717","95.718","95.717","95.717","95.717"]
    (1 row)
    
    SELECT STRING_TO_ARRAY('[95.717,95.718,95.717,95.717,95.717]', ',')::ARRAY[FLOAT];
               STRING_TO_ARRAY
    --------------------------------------
     [95.717,95.718,95.717,95.717,95.717]
    (1 row)
    

    Does it answer your need?

  • SergeBSergeB Employee
    Accepted Answer

    @mosheg casting (your second example) works only from 10.0.1 onwards.

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.