Triggers - Urgent
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Triggers - Urgent

  1. #1
    Join Date
    Oct 2000
    Posts
    449
    Hi :
    I have a table that has 5 fields of which the 5th field is status and is default 'ACTIVE' when inserted. But when someone deletes, I want the row to be there and make it inactive for status. I hope I am clear.

    How would you write the trigger..


    SQL> desc tbl_applist
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    APPLICATION_ID NOT NULL VARCHAR2(10)
    BWPERSEC NUMBER(5)
    APPLICATION_IP VARCHAR2(23)
    APPLICATION_PORT NUMBER(5)
    STATUS VARCHAR2(10)

    SQL> select * from tbl_applist;

    APPLICATIO BWPERSEC APPLICATION_IP APPLICATION_PORT STATUS
    ---------- ---------- ----------------------- ---------------- ----------
    3 2 ACTIVE
    4 2 ACTIVE

  2. #2
    Join Date
    Nov 2000
    Posts
    7

    Wink

    you can easily do this with front end. I

  3. #3
    Join Date
    Jun 2000
    Posts
    417
    you would want to use an "instead of delete" trigger, and update the status to INACTIVE for the row being modified instead of deleting the row. check oracle documentation on how to write the trigger, if you have problems post away.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width