title: how to set the date to current date automatically on insert
body: <p>I have the following table </p>
  
  <pre><code>CREATE TABLE ex(
   id INTEGER PRIMARY KEY,
   dat DATE NOT NULL CHECK(dat IS date(dat))
  );
  </code></pre>
  
  <p>And I want dat to be set to date('now') automatically on every insert.
  Thats why I created a TRIGGER</p>
  
  <pre><code>CREATE TRIGGER setTrigger
           AFTER INSERT
              ON ex
  FOR EACH ROW
  BEGIN   
      UPDATE ex   
          SET dat = date('now')
      WHERE id = NEW.id;
  END;
  </code></pre>
  
  <p>But I'm getting the following error :</p>
  
  <pre><code>too many levels of recursion
  </code></pre>
  
  <p>How can I fix this ?</p>