Razzak, Thank you for the detailed answer which cleared up any question I had. As always you and your fine team are on the ball and giving Superb service to the R:Base community.
Thank you again for your time and effort. Richard (Ringo) Starkey -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of A. Razzak Memon Sent: Monday, June 10, 2002 11:01 PM To: [EMAIL PROTECTED] Subject: Re: Insert Trigger question! - Razzak's Reply At 11:16 AM 6/10/2002 -0400, Richard (Ringo) Starkey wrote: >My question is this: > >If I am processing data with a cursor while loop and an insert into the >Person table fails because there is no LastName will the trigger fire and >insert the PK value into the percono table? Richard, Since a trigger runs a stored procedure before the row that triggered it is updated, inserted, or deleted, you can cancel the update, insert, or delete with the ABORT TRIGGER command in the stored procedure. You can TRACE any stored procedure by using the following command at the R> prompt: TRACE SELECT SYS_PROC_SRC FROM SYS_PROCEDURES WHERE + SYS_PROC_NAME = 'ProcName' The upcoming In-line Patch-3, Build:1.855xRT03, includes the support for BEFORE and AFTER TRIGGERS. The current triggers are all "BEFORE" triggers in that they run just before the actual insert, update, or delete and give you the ability to abort the action. The new triggers are "AFTER" triggers in that they run just after the action. Since the modified data has been "committed" you cannot abort the action in an AFTER trigger. LIST TRIGGERS and UNLOAD command has also been updated to include these changes. The new triggers can be created by the create table command or by the alter table command. When you use the alter table command you must define the insert triggers in the same command. The same goes for update and delete. Do not use one alter table command to add the "BEFORE" insert trigger and then another alter table to add the "AFTER" trigger. Do them both in the same command. When you drop a trigger, you do not specify the "BEFORE" or "AFTER" trigger. The drop of the insert trigger, for example, drops both parts of they are there. Enjoy the ENHANCED functionality of Stored Procedures and Triggers! Very Best Regards, Razzak. ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/ ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
