<?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>question Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391242#M247529</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/111639"&gt;@Brunno&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2024 22:54:32 GMT</pubDate>
    <dc:creator>DianaTorres</dc:creator>
    <dc:date>2024-07-31T22:54:32Z</dc:date>
    <item>
      <title>how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391236#M247527</link>
      <description>&lt;P&gt;&lt;SPAN&gt;how are you? I need assistance with converting a string to an integer or numeric value using Apache NiFi’s UpdateRecord processor. I’ve tried using toNumber and toInt, but neither worked. Can you provide guidance on how to achieve this conversion?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brunno_0-1722457722414.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41323iF11C13FF2615F8D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brunno_0-1722457722414.png" alt="Brunno_0-1722457722414.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;tHANK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 20:30:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391236#M247527</guid>
      <dc:creator>Brunno</dc:creator>
      <dc:date>2024-07-31T20:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391242#M247529</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/111639"&gt;@Brunno&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 22:54:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391242#M247529</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-07-31T22:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391370#M247585</link>
      <description>&lt;P&gt;So, my problem now is that I can't insert it into my database using the PutDatabaseRecord processor. It is reporting this error: "13:42:05 BRT ERROR PutDatabaseRecord[id=fe4d0a37-0190-1000-7115-2eb52a682eef] Failed to put Records to database for FlowFile[filename=788b7747-61ed-4eb8-bbdc-7a26b0521352]. Routing to failure: java.sql.BatchUpdateException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. ". My data comes as a string (in this format: "QTDEMBALAGEM" : "3", "VALIDITY DATE" : "2023-01-01 00:00:00.0", "DTAFABRICACAO" : "2020-09-23 00:00:00.0").&lt;/P&gt;&lt;P&gt;Before inserting, my data goes through the UpdateRecord processor, where the obligation is to convert it to datetime. I use these commands to do this conversion: (toDate(/DTAFABRICACAO, 'yyyy-MM-dd HH:mm:ss.S')) and (toDate(/DTAVALIDADE, 'yyyy-MM-dd HH:mm:ss. S')).&lt;/P&gt;&lt;P&gt;Unfortunately I don't know how to avoid this error and be able to insert it into the database.&lt;BR /&gt;&lt;BR /&gt;Help me NiFi experts &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt; &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt; &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brunno_1-1722877127774.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41359i852622DDE54CA460/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brunno_1-1722877127774.png" alt="Brunno_1-1722877127774.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brunno_2-1722877141163.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41360i411F0B583B8ECB55/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brunno_2-1722877141163.png" alt="Brunno_2-1722877141163.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brunno_3-1722877189828.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41361i7FBE6A99642DC4AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brunno_3-1722877189828.png" alt="Brunno_3-1722877189828.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brunno_4-1722877202911.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41362i7C26A025AD8FDC27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brunno_4-1722877202911.png" alt="Brunno_4-1722877202911.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 17:00:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391370#M247585</guid>
      <dc:creator>Brunno</dc:creator>
      <dc:date>2024-08-05T17:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391426#M247614</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/31975"&gt;@bbahamondes&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86141"&gt;@haridjh&lt;/a&gt;&amp;nbsp;Hi! Do you have any insights here? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 21:31:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391426#M247614</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-08-06T21:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391456#M247634</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;It seems the data is being converted into none datetime format . when I try a simple input with the date you provided and then do an Update Record using the toDate function I get an an epoch time which is a long integer value, Im not sure why this is happening but if you are using records reader like avro or json and you use the infer schema setting the output can be unpredictable. I would suggest to not do an update record on the date values and just try to insert them as they come since they look to be a valid datetime format string.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 11:36:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391456#M247634</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-08-07T11:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391535#M247662</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/111639"&gt;@Brunno&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;In ExecuteSQL ,&amp;nbsp;&lt;SPAN&gt;Query result will be converted to Avro format. Therefore , use the Convert Avro* or related processors to have the avro data converted to correct formatted file and then update to the target DB&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/2.0.0/org.apache.nifi.processors.standard.ExecuteSQL/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/2.0.0/org.apache.nifi.processors.standard.ExecuteSQL/index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 10:42:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391535#M247662</guid>
      <dc:creator>haridjh</dc:creator>
      <dc:date>2024-08-08T10:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert string to integer or numeric using apache nifi processor UpdateRecord</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391591#M247683</link>
      <description>&lt;P&gt;I did as suggested by colleague &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;. I saved column by column, until I discovered that I had corrupted data. I had a data where the year was like "1111". As I had little experience, it was difficult to spot possible errors. Thank you everyone, especially my colleague &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/85506"&gt;@diana&lt;/a&gt;&lt;A class="dcxa-lithium-link" href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/93628" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;DianaTorres&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 19:35:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-convert-string-to-integer-or-numeric-using-apache/m-p/391591#M247683</guid>
      <dc:creator>Brunno</dc:creator>
      <dc:date>2024-08-09T19:35:28Z</dc:date>
    </item>
  </channel>
</rss>

