title: Swift Sqlite3_column_text()
body: <pre><code>if sqlite3_prepare_v2(db, "select a from aaa", -1, &amp;q,nil) == SQLITE_OK {
      while sqlite3_step(q) == SQLITE_ROW {
          let res = sqlite3_column_text(q, 1)
          print(res)
      }
  } else {
      print("NOT WORKING")
      NSLog("%s", sqlite3_errmsg(db))
  }
  </code></pre>
  
  <p>In my table aaa I have a field named 'a' and values 1,2,3 as shown here :</p>
  
  <p><a href="https://i.stack.imgur.com/5xHs2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5xHs2.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to put the values in an array or just print them, but when I print <code>(print(res))</code>, the values are just "<code>nil</code>".</p>
  
  <p>How can I get the real values?</p>
  
  <p>EDIT: the values (1,2,3) are strings and not intagers, that why i chose sqlite3_column_text() and not sqlite3_column_int()</p>