Data Decode not working as expected Postgres

Highlighted
One Star

Data Decode not working as expected Postgres

Im using the below update statement to decode a value in column .

 

update table set col =substring(decode(decode(col,'escape')::text,'hex')::varchar,1,25)

 

it works fine when i run it in pgadmin/dbeaver or any client tools.. but the same is not working when running via talend tpostgresrow component.

 

In Client tools:

sample values: select substring(decode(decode('2342354354','escape')::text,'hex')::varchar,1,25)

Op: "#B5CT"

 

in talend 

op : "\x2342354354"

 

Highlighted
Thirteen Stars

Re: Data Decode not working as expected Postgres

23 = #
54 = T
from hex to acsii
so tis' working but the driver used to connect postgres do not translate response as acsii.
check your driver/db configuration or use TEXT(x) data type or convert result to ascii or utf8 char.
good luck

Francois Denis

Tag as "solved" for others! Kudos to thanks!

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog