python sqlite3 unrecognized token
<p>I am trying to do some simple operations in sqlite with python. I have the test database created and have created a table but when I try to insert my data into it I get an 'unrecognized token' error. </p>

<blockquote>
  <p>c.execute("create table node(changeset int, uid int, timestamp text, lon real, visible int, version int, user text, lat real, id int)")</p>
</blockquote>

<p>Creates the table. but when I try to insert the first line of data: </p>

<blockquote>
  <p>c.execute("insert into node values(8581395,451048,2011-0629T14:14:14Z,-87.6939548,true,5,bbmiller,41.9729565,261114299)")</p>
</blockquote>

<p>I get the error: </p>

<p>OperationalError: unrecognized token: "29T14"</p>

<p>What is wrong with it? </p>

<p>The line</p>

<pre><code>c.execute("insert into node values(8581395,451048,2011-0629T14:14:14Z,-87.6939548,true,5,bbmiller,41.9729565,261114299)")
</code></pre>

<p>should be</p>

<pre><code>c.execute("insert into node values(8581395, 451048, '2011-0629T14:14:14Z', -87.6939548, 1, 5, 'bbmiller', 41.9729565, 261114299)")
</code></pre>

<p>Notice two relevant changes:</p>

<ol>
<li><p>I've changed all the text fields to be nested into quote marks</p></li>
<li><p>True becomes an Integer as SQLite do not store booleans as an specific type.</p></li>
</ol>

<p>From <a href="https://www.sqlite.org/datatype3.html" rel="nofollow">https://www.sqlite.org/datatype3.html</a>:</p>

<blockquote>
  <p>SQLite does not have a separate Boolean storage class. Instead,
  Boolean values are stored as integers 0 (false) and 1 (true).</p>
</blockquote>

<p>Thus the boolean values comming from python must be translated into 0
or 1.</p>

python sqlite3