Skip to main content
Solved

Hello guys,I have a varchar column in my database and i would like to replace the 7th character (starting by the end) from a . to a _ I try to use the function LEN but its not working... error message :ERROR: Function LEN(varchar) does not exist

  • June 1, 2023
  • 3 replies
  • 7 views

initial output :

C76_XX_XXXX_INVOICE_LIV_XXXX_XXX.001.pdf

 

what i would like :

C76_XX_XXXX_INVOICE_LIV_XXXX_XXX_001.pdf

 

Thanks for your help

Best answer by guillermo.gost12

LENGTH and CHARACTER_LENGTH are implemented in SQL Vertica in Celonis

 

image 

RIGHT, LEFT and CONCAT works. I gues you want something similar to:

 

select COLUMN, LENGTH(COLUMN), LEFT(COLUMN,3), RIGHT(COLUMN,6), CONCAT(CONCAT(LEFT(COLUMN,3),'A'),RIGHT(COLUMN,6)) AS MiddleCharChanged from "TABLE"

 

image 

HTH

3 replies

Data Ingestion (i.e. SQL), Studio (then PQL), Action Flows... ?


hello, yes i should have mention it ! Data Ingestion (SQL)


LENGTH and CHARACTER_LENGTH are implemented in SQL Vertica in Celonis

 

image 

RIGHT, LEFT and CONCAT works. I gues you want something similar to:

 

select COLUMN, LENGTH(COLUMN), LEFT(COLUMN,3), RIGHT(COLUMN,6), CONCAT(CONCAT(LEFT(COLUMN,3),'A'),RIGHT(COLUMN,6)) AS MiddleCharChanged from "TABLE"

 

image 

HTH