If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > About PL\SQL Trigger...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-04, 13:48
DonnyDB DonnyDB is offline
Registered User
 
Join Date: Apr 2004
Posts: 13
About PL\SQL Trigger...

Hi all, I just wondering, when we should use Trigger statement and Trigger row? Because I'm not really understand in this part.

emm, where I can get complete free tutorial about this SQL Trigger?

Thanks in advance.
__________________
Correct me if I wrong.
Reply With Quote
  #2 (permalink)  
Old 04-19-04, 03:25
zeus77 zeus77 is offline
Registered User
 
Join Date: Mar 2004
Location: Venice,Italy
Posts: 20
the difference is when you insert more row in a time (tipically with a insert into ... select..)
Trigger statement is tipically faster, because is called one time, trigger row are tipically more easy to write because you have to manage only a row a time.
Trigger statement can be usefull also for checking a complex check that involve a set of row as a whole (for example chaecking the sum of a column must to be zero...)
pay attention that not every rdbm has both: for example, MS SQL has only the trigger statement, sqlite "for each row " only...
Reply With Quote
  #3 (permalink)  
Old 04-19-04, 08:42
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: About PL\SQL Trigger...

You mention PL/SQL, so you are talking about Oracle triggers. See the free online documentation here:

Application Developer's Guide

Concepts
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #4 (permalink)  
Old 04-19-04, 08:45
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: About PL\SQL Trigger...

Regarding your first question:
  • Statement-level triggers fire once only per statement, and cannot refer to specific row values using :OLD and :NEW
  • Row-level triggers fire once per row affected by the statement, and can refer to specific row values using :OLD and :NEW
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On