I have a foreach loop,After the foreach trigger fired.So the thing is i need to fire this trigger after the whole foreach ended.(In here the issue is when first item hits to the table then trigger immediately fired.
foreach (var item in NewsTypes.nIDs)
{
String query2 = "INSERT INTO TBL_NEWS_TYPE_REGIONS (ID, RID, ISACTIVE) VALUES (id.currval, :RID, :ISACTIVE)";
cmd = db.GetSqlStringCommand(query2);
db.AddInParameter(cmd, "ID", DbType.Int32, item);
db.AddInParameter(cmd, "ISACTIVE", DbType.String, "1");
db.ExecuteNonQuery(cmd);
}
//db.ExecuteNonQuery(cmd); <-- When i put this here only the last item inserted to the table.
Trigger Starts with:
CREATE OR REPLACE TRIGGER NEWSCHK.NEWSTRG
AFTER INSERT
ON NEWSCHK.TBL_NEWS_TYPE_REGIONS