<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic REST CONNECTOR - decoding MIME64/BASE64 SQL data in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-CONNECTOR-decoding-MIME64-BASE64-SQL-data/m-p/1766916#M5592</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using with success various Rest Connectors to retrieve data from our CRM software (based on CRM api).&lt;/P&gt;&lt;P&gt;One of my connectors is based on a SQL that is generating 3 columns. One of the columns contains data that are recognized as Base64 data.&lt;/P&gt;&lt;P&gt;For example, the output of one record is "Sk9ITiBERUVSRXxORVcgSE9MTEFORA==" when the original data is "JOHN DEERE|NEW HOLLAND"&lt;/P&gt;&lt;P&gt;The SQL looks like :&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;COMP.K_COMPANY,&lt;BR /&gt;COMP.F_SAP,&lt;BR /&gt;&lt;STRONG&gt;TRACTOR_BRAND&lt;/STRONG&gt; = &lt;STRONG&gt;STUFF&lt;/STRONG&gt;&lt;BR /&gt;(&lt;BR /&gt;(&lt;BR /&gt;select '|'+&lt;BR /&gt;(select F_VALUE from LK_BRAND_MARQUE L8 where L8.K_BRAND_MARQUE=BRANDS.F_MARQUE)&lt;BR /&gt;from&lt;BR /&gt;COMPANIES COMPANIES,BRAN_COMP, BRANDS&lt;BR /&gt;where&lt;BR /&gt;COMPANIES.K_COMPANY = BRAN_COMP.K_COMPANY&lt;BR /&gt;and&lt;BR /&gt;BRAN_COMP.K_BRAND = BRANDS.K_BRAND&lt;BR /&gt;and&lt;BR /&gt;comp.K_COMPANY=COMPANIES.K_COMPANY&lt;BR /&gt;&lt;STRONG&gt;FOR XML PATH (''), TYPE).value('.', 'varchar(max)'), 1, 1, '')&lt;/STRONG&gt;&lt;BR /&gt;from COMPANIES COMP, BRAN_COMP&lt;BR /&gt;where COMP.K_COMPANY = BRAN_COMP.K_COMPANY&lt;BR /&gt;and comp.k_company='3425'&lt;BR /&gt;group by comp.k_company, COMP.F_SAP&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to convert the Tractor_Brand on the SQL side using&amp;nbsp;cast(TRACTOR_BRAND as nvarchar(max)) as TRACTOR_BRAND_text . But the result is the same in the rest connector.&lt;/P&gt;&lt;P&gt;So, I wonder if there is a function I could use in my load statement to be able to decode the Tractor_Brand field from Base64 to string ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 08:07:36 GMT</pubDate>
    <dc:creator>patricesalem</dc:creator>
    <dc:date>2020-12-08T08:07:36Z</dc:date>
    <item>
      <title>REST CONNECTOR - decoding MIME64/BASE64 SQL data</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-CONNECTOR-decoding-MIME64-BASE64-SQL-data/m-p/1766916#M5592</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using with success various Rest Connectors to retrieve data from our CRM software (based on CRM api).&lt;/P&gt;&lt;P&gt;One of my connectors is based on a SQL that is generating 3 columns. One of the columns contains data that are recognized as Base64 data.&lt;/P&gt;&lt;P&gt;For example, the output of one record is "Sk9ITiBERUVSRXxORVcgSE9MTEFORA==" when the original data is "JOHN DEERE|NEW HOLLAND"&lt;/P&gt;&lt;P&gt;The SQL looks like :&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;COMP.K_COMPANY,&lt;BR /&gt;COMP.F_SAP,&lt;BR /&gt;&lt;STRONG&gt;TRACTOR_BRAND&lt;/STRONG&gt; = &lt;STRONG&gt;STUFF&lt;/STRONG&gt;&lt;BR /&gt;(&lt;BR /&gt;(&lt;BR /&gt;select '|'+&lt;BR /&gt;(select F_VALUE from LK_BRAND_MARQUE L8 where L8.K_BRAND_MARQUE=BRANDS.F_MARQUE)&lt;BR /&gt;from&lt;BR /&gt;COMPANIES COMPANIES,BRAN_COMP, BRANDS&lt;BR /&gt;where&lt;BR /&gt;COMPANIES.K_COMPANY = BRAN_COMP.K_COMPANY&lt;BR /&gt;and&lt;BR /&gt;BRAN_COMP.K_BRAND = BRANDS.K_BRAND&lt;BR /&gt;and&lt;BR /&gt;comp.K_COMPANY=COMPANIES.K_COMPANY&lt;BR /&gt;&lt;STRONG&gt;FOR XML PATH (''), TYPE).value('.', 'varchar(max)'), 1, 1, '')&lt;/STRONG&gt;&lt;BR /&gt;from COMPANIES COMP, BRAN_COMP&lt;BR /&gt;where COMP.K_COMPANY = BRAN_COMP.K_COMPANY&lt;BR /&gt;and comp.k_company='3425'&lt;BR /&gt;group by comp.k_company, COMP.F_SAP&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to convert the Tractor_Brand on the SQL side using&amp;nbsp;cast(TRACTOR_BRAND as nvarchar(max)) as TRACTOR_BRAND_text . But the result is the same in the rest connector.&lt;/P&gt;&lt;P&gt;So, I wonder if there is a function I could use in my load statement to be able to decode the Tractor_Brand field from Base64 to string ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 08:07:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-CONNECTOR-decoding-MIME64-BASE64-SQL-data/m-p/1766916#M5592</guid>
      <dc:creator>patricesalem</dc:creator>
      <dc:date>2020-12-08T08:07:36Z</dc:date>
    </item>
  </channel>
</rss>

