title: How to set a default value to a TEXT column in Sqlite?
body: <p>I have a simple table. I'm trying to put a default value to a TEXT column. Here is the table query:</p>
  
  <pre><code>"CREATE TABLE book(_id INTEGER PRIMARY KEY AUTOINCREMENT, book_id TEXT NOT NULL DEFAULT '0', book_name TEXT NOT NULL);"   
  </code></pre>
  
  <p>It creates the table but the problem occurs when i try to insert a data. I was only trying with giving a book name to <strong>book_name</strong>, as i expected that the <strong>book_id</strong> would have a default value 0 to the column. But it doesn't and it adds the null value, so the row doesn't get inserted. I have also tried with this query:</p>
  
  <pre><code>"CREATE TABLE book(_id INTEGER PRIMARY KEY AUTOINCREMENT, book_id TEXT NOT NULL DEFAULT \'0\', book_name TEXT NOT NULL);"     
  </code></pre>
  
  <p>But the problem remains the same. I have searched the stack overflow, and got some answers but they are old and not working for me right now. So has something changed on how to set the default value to a TEXT column in sqlite. Thanks in advance :)</p>
  
  <p><strong>EDIT</strong><br>
  Here is the insert statement:</p>
  
  <pre><code>database.insert("book", null, cv);    
  </code></pre>
  
  <p>Here <strong>cv</strong> is the object of <strong>ContentValues</strong> which contains only the value for the column <strong>book_name</strong>.</p>