title: SQLiteDatabase update using replace function
body: <p>I want to use the SQLiteDatabase to perform an update using the SQLite <code>replace</code> function with a <code>LIMIT</code> where the SQL would amount to something like this:</p>
  
  <pre><code>UPDATE tbl SET tel = replace(tel, '0501', '0502') where tel in (SELECT tel FROM tbl WHERE tel LIKE '0501%' ORDER BY tel LIMIT 100);
  </code></pre>
  
  <p>This appears to be good SQL as in this <a href="http://sqlfiddle.com/#!7/acccd6/1" rel="nofollow noreferrer">fiddle</a>.</p>
  
  <p>So the signature of the update looks something like:</p>
  
  <pre><code>db.update(String table, ContentValues values, String whereClause, String[] whereArgs)
  </code></pre>
  
  <p>So I tried as a wild guess using <code>ContentValues</code> like:</p>
  
  <pre><code>ContentValues cv = new ContentValues();
  cv.put("tel","replace( tel, '0511', '0513' )");
  int result = db.update(tableName,cv,whereClause,null);
  </code></pre>
  
  <p>and that doesn't execute the <code>REPLACE</code> function but takes it literally so.</p>
  
  <p>So how to use the <code>REPLACE</code> function using the <code>update</code> is the question.</p>
  
  <p>I need to know how many rows are affected.</p>
  
  <p>EDIT: I changed the query to a valid SQLite syntax per comment link and now see it is valid but the <code>REPLACE</code> is not being evaluated.</p>