What is the syntax for using triggers?

Showing Answers 1 - 3 of 3 Answers

basavaraj kolur

  • Sep 29th, 2006

dear friend,syntax for using any trigger

  create or replace trigger triname

 before/after insert or update of column,column or delete on tablename

for each row

[when codition]

plsql block;

this is syntax for creating database trigger on table

we can also creating trigger for system level or schema level..

  Was this answer useful?  Yes


  • Feb 18th, 2007

create or replace trigger <trig_name>

{Before/After} {Insert/Update/Delete} on <table_name>

[Referencing [New as <new_name>]  [Old as <old_name>]]

[For each row [When (<trigger_condition>)]]


  Was this answer useful?  Yes

Create or replace trigger <trig_name>

{Before/After} {Insert/Update/Delete} on <table_name>

[Referencing [ New as <new_name> ] [ Old as <old_name> ]

[For each row [When <trigger_condition>]]


  Was this answer useful?  Yes

vaibhav Tyagi

  • Sep 26th, 2007

FOR- Sql Server

Create trigger TestTrigger
on tableaName
instead of insert
begin transaction
declare @aid int
set @aid=0

select @aid = max([columnName]) from tableName

if @aid <> 0

--do operation

commit transaction

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions