Skip to main content
Question

error when creating json_extract UDF

  • April 19, 2020
  • 0 replies
  • 8 views

aryehgielchinsky

Hello I'm getting the following error when I try to create a function in Vertica.

SQL Error [3854] [42V13]: [Vertica]VJDBC ROLLBACK: Length of a string in a return type must be greater than zero

CREATE or replace FUNCTION dbr.json_extract(col1 VARCHAR, key1 VARCHAR) RETURN varchar AS BEGIN RETURN MAPLOOKUP(MapJSONExtractor(CASE WHEN RIGHT(col1,1)='}' THEN col1 END), key1)::VARCHAR; END;

Any idea what the issue is? I sending the query with dbeaver 7.0.0 and the database version is Vertica Analytic Database v9.3.0-2.
Thanks