Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2003, 01:15 PM
Registered User
 
Join Date: Dec 2003
Location: , , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Triggers!

How can you tell what field has been changed in an Oracle Trigger?
and what the values were/are?

In SQL Server you can use the Deleted and Inserted tables, is there something similar in Oracle? and if so how do you access them?

Mark Anderson

  #2 (permalink)  
Old December 5th, 2003, 01:34 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CREATE OR REPLACE TRIGGER trg_ssn
   BEFORE INSERT ON Patient
   FOR EACH ROW
 BEGIN
     If (:new.ssn) is null then
        IF sysdate - :new.dob < 730 THEN
           RAISE_APPLICATION_ERROR (-20500, 'Patient must be');
        END IF;
     end if;
end trg_ssn;
/
show errors;
________________________

you use the :new operator and :old operator. Close to the same as SQL Server.
Do a search on the web for those two operators.



Sal
 


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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggers? odezzie Classic ASP Databases 1 March 28th, 2007 06:09 PM
Triggers mrookey SQL Server 2000 2 October 24th, 2006 07:11 AM
Triggers? prabodh_mishra Oracle 2 March 30th, 2006 05:51 AM
Triggers shahchi1 SQL Server 2000 1 November 1st, 2004 06:28 PM



All times are GMT -4. The time now is 03:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.