sqlite3.OperationalError: near "WHERE": syntax error
<p>I want to update a series of columns Country1, Country2... Country 9 based on a comma delimited string of country names in column Country. I've programmed a single statement to accomplish this task. </p>

<pre><code>cur.execute("\
            UPDATE t \
            SET Country1 = returnCountryName(Country,0),\
                Country2 = returnCountryName(Country,1),\
                Country3 = returnCountryName(Country,2),\
                Country4 = returnCountryName(Country,3),\
                Country5 = returnCountryName(Country,4),\
                Country6 = returnCountryName(Country,5),\
                Country7 = returnCountryName(Country,6),\
                Country8 = returnCountryName(Country,7),\
                Country9 = returnCountryName(Country,8),\
                Country10 = returnCountryName(Country,9),\
            WHERE Country IS NOT NULL\
            ;")
</code></pre>

<p>Howerver, I am getting the error</p>

<pre><code>sqlite3.OperationalError: near "WHERE": syntax error
Press any key to continue . . .
</code></pre>

<p>You have to remove the comma from the last assignment:</p>

<pre><code>Country10 = returnCountryName(Country,9),\
</code></pre>

<p>See also <a href="http://stackoverflow.com/a/39690916/6776093">my answer</a> to your original question</p>

python sqlite