Convert varying to Text

Options
Thomas Bartmann
Thomas Bartmann Customer
Advocate First Comment First Anniversary
edited January 23 in Platform

Hi All, I want to import values from a postgre database using Data Reader. However, some values are in varying format. How can I convert them to text in the Data Reader?

Tagged:

Answers

  • Samson Sunny
    Options

    Hi @Thomas Bartmann,

    Are you trying to load the varchar field column into a text cube? Usually the data reader should pick up the varchar values as text when you load into a text cube. Does it throw an error in Data Reader logs when you do this?

    Thanks,
    Samson.

  • Thomas Bartmann
    Options

    Hi Samson, I trying to load it into entity desription and I get this error:

  • Samson Sunny
    Samson Sunny Employee
    April Badge of the Month Community Captain February Badge of the Month 5 Likes
    edited January 26
    Options

    Hi Thomas,

    This error usually occurs when the server and client encoding differ, and the database driver tries to translate between those two encoding. When it cannot find an equivalent character, this error is thrown. So the server encoding and client encoding should be the same to avoid the error you see.

    Type the following commands on your database one by one to check the server and client encodings and change the client encoding from WIN1252 to UTF8:

    show server_encoding;

    show client_encoding;

    set client_encoding to 'utf8';

    If this still does not fix the issue, try changing the ODBC PostgreSQL driver to the Board Postgre driver or the PostgreSQL ODBC driver (UNICODE).

    Let me know if this fixes the issue.