title: Error in syntax of define a trigger in SQLite
body: <p>In a table as below:</p>
  
  <pre><code>CREATE TABLE "active_mtrs" 
  (
       "mtr_ID" INTEGER PRIMARY KEY NOT NULL,
       "status" INTEGER, 
       "NIrSTime" DATETIME, 
       "NIrETime" DATETIME
  )
  </code></pre>
  
  <p>I defined a trigger as:</p>
  
  <pre><code>CREATE TRIGGER "main"."replace1" 
  AFTER INSERT ON "active_mtrs" FOR EACH ROW  
  BEGIN 
      DECLARE @NIrSTime DATETIME;
      DECLARE @NIrETime DATETIME;
      DECLARE @mtr_ID INTEGER DEFAULT 0;
  
      SELECT @mtr_ID = mtr_ID FROM INSERTED;
  
      SELECT @NIrSTime = NIrSTime,@NIrETime = NIrETime 
      FROM subscriber 
      WHERE mtr_ID = @mtr_ID;
  
      UPDATE active_mtrs 
      SET NIrSTime = @NIrSTime,
          NIrETime = @NIrETime 
      WHERE mtr_ID = @mtr_ID; 
  END
  </code></pre>
  
  <p>where <code>subscriber</code> is another table in this database.</p>
  
  <p>But I get an error:</p>
  
  <blockquote>
    <p>[ near "DECLARE": syntax error ]<br>
    Exception Name: NS_ERROR_FAILURE<br>
    Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) </p>
  </blockquote>
  
  <p>What is my problem?</p>