in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

DROP & CREATE TRIGGER FAIL

Last post 02-06-2010 7:56 PM by ujin. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-06-2010 7:56 PM

    • ujin
    • Top 200 Contributor
    • Joined on 04-07-2009
    • Posts 7

    DROP & CREATE TRIGGER FAIL

    Hi,

    I'm trying to execute the following commands inside a transaction from vb .NET with System.Data.SQLite.

    DROP TRIGGER trigger_name;

    CREATE TRIGGER trigger_name

    AFTER DELETE
    ON table_name
    FOR EACH ROW
    BEGIN
    DELETE FROM table_name_2 WHERE condition_A;
    DELETE FROM table_name_3 WHERE condition_B;
    END;

    Code
    -------

    SQLiteConnection con;
    SQLiteCommand cmd;
    T = con.BeginTransaction();
    cmd.CommandText = CommandA;
    cmd.ExecuteNonQuery();
    cmd.CommandText = CommandB;
    cmd.ExecuteNonQuery();
    T.Commit;
    It runs without errors but fail to drop and create the trigger

    does anyone know why?
    Thanks in advance,
    Ujin
Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems