<?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 Re: SQL Executor syntax for update statement using @Value for a string in ArcGIS Data Interoperability Ques.</title>
    <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483646#M259</link>
    <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;Both statements with, and without the single quote return the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = @Value(PARCEL_NUMBER)&lt;/P&gt;&lt;P&gt;Microsoft SQL Server Non-Spatial Reader: Query failed, possibly due to a malformed statement. Query Text `UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = 340750300650005'. Provider error `(-2147217913) Error converting data type varchar to numeric.'&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where PARCELID = @Value(PARCEL_NUMBER)&lt;/P&gt;&lt;P&gt;Microsoft SQL Server Non-Spatial Reader: Query failed, possibly due to a malformed statement. Query Text `UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where PARCELID = 342073108650005'. Provider error `(-2147217913) Error converting data type nvarchar to numeric.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The parcel number is a text string and should have quotes. This works with python and in SQL.&lt;/P&gt;&lt;P&gt;update ADDRESSES_TEST set internalonly = 1 where PARCELID = '342073103690008'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i take the quotes away from the PARCELID and run in SQL, the same conversion error is given&lt;/P&gt;&lt;P&gt;Error converting data type nvarchar to numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very much appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2024 21:23:46 GMT</pubDate>
    <dc:creator>MichaelKohler</dc:creator>
    <dc:date>2024-06-03T21:23:46Z</dc:date>
    <item>
      <title>SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483616#M257</link>
      <description>&lt;P&gt;We have a FME workspace where I need to update rows in the table that meet a where condition. The condition is a string value. When I set up the sql statement it is like this.&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = @Value(PARCEL_NUMBER)&lt;/LI-CODE&gt;&lt;P&gt;and when the executor is run, the below error is returned for each feature.&lt;/P&gt;&lt;P&gt;Query failed, possibly due to a malformed statement. Query Text&amp;nbsp;&amp;nbsp; UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = 342073103690008&amp;nbsp; Provider error `(-2147217913) Error converting data type varchar to numeric.'&lt;/P&gt;&lt;P&gt;The PARCEL_NUMBER and the PARCELID fields are TEXT in both instances. This is what was used in python.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;UPDATE ADDRESSES_TEST SET internalonly = 1 WHERE PARCELID = '{}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;where the PARCEL_NUMBER is quoted. Also, internalonly is a smallint in both databases&lt;/P&gt;&lt;P&gt;Any leads would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 20:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483616#M257</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-06-03T20:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483636#M258</link>
      <description>&lt;P&gt;Michael the single quotes around PARCELID make it a literal and not an identifier.&amp;nbsp; Just remove them.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 21:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483636#M258</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2024-06-03T21:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483646#M259</link>
      <description>&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;Both statements with, and without the single quote return the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = @Value(PARCEL_NUMBER)&lt;/P&gt;&lt;P&gt;Microsoft SQL Server Non-Spatial Reader: Query failed, possibly due to a malformed statement. Query Text `UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where 'PARCELID' = 340750300650005'. Provider error `(-2147217913) Error converting data type varchar to numeric.'&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where PARCELID = @Value(PARCEL_NUMBER)&lt;/P&gt;&lt;P&gt;Microsoft SQL Server Non-Spatial Reader: Query failed, possibly due to a malformed statement. Query Text `UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where PARCELID = 342073108650005'. Provider error `(-2147217913) Error converting data type nvarchar to numeric.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The parcel number is a text string and should have quotes. This works with python and in SQL.&lt;/P&gt;&lt;P&gt;update ADDRESSES_TEST set internalonly = 1 where PARCELID = '342073103690008'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i take the quotes away from the PARCELID and run in SQL, the same conversion error is given&lt;/P&gt;&lt;P&gt;Error converting data type nvarchar to numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very much appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 21:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483646#M259</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-06-03T21:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483655#M260</link>
      <description>&lt;P&gt;use SQL Server function CAST or CONVERT&amp;nbsp;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver16" target="_blank"&gt;https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver16&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 21:44:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483655#M260</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T21:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483670#M261</link>
      <description>&lt;P&gt;Thank you. That did the trick&lt;/P&gt;&lt;P&gt;UPDATE ADDRESSES.dbo.ADDRESSES_TEST set internalonly = 1 where PARCELID = CAST(@Value(PARCEL_NUMBER) As nvarchar)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 22:00:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483670#M261</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2024-06-03T22:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Executor syntax for update statement using @Value for a string</title>
      <link>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483671#M262</link>
      <description>&lt;P&gt;Glad to help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 22:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-data-interoperability-ques/sql-executor-syntax-for-update-statement-using/m-p/1483671#M262</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-06-03T22:05:39Z</dc:date>
    </item>
  </channel>
</rss>

