We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Error while inserting data into a table with array type columns — Vertica Forum

Error while inserting data into a table with array type columns

edited January 2024 in General Discussion

Hi
I am using vertica version "Vertica Analytic Database v12.0.4-11" have a table like this

CREATE TABLE public.test
(
id int,
LINKS array[varchar(2048), 250]
);

If I try to insert multiple rows in to the above table like this

insert into test values
(1, '[http://www.somelink123.com/cummins-qsb3-9-engine.html,http://www.facebook.com/]' ),
(1, '[http://www.somelink123.com/somenew-link/somenew-link-reallynew-link/somenewlink-link-new.html,http://www.facebook.com/]')

getting an error which says

09:29:11 START Executing for: 'Vertica' [Vertica], Schema: public
09:29:11 FAILED [INSERT - 0 rows, 0.683 secs] [Code: 9988, SQL State: 22V02] [Vertica]VJDBC **ERROR: Invalid input syntax for type Varchar(80): "http://www.somelink123.com/somenew-link/somenew-link-reallynew-link/somenewlink-link-new.html"
**

strangely although I have defined the type in the array as varchar(2048) I still see varchar(80) for the second row which is having values beyond 80 charecters error while inserting data

at the same time if I try to insert just one value lets say just the second value which is having strings beyond 80 charecters it works!!

What am I missing here?

Answers

Leave a Comment

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