Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    78

    Unanswered: trigger for update

    When using "ON DELETE CASCADE " data in child tables automatically removed when parent table gets deteted

    How to write trigger for update .I has follwed as for deleting cascade




    create table n1(no number,name varchar2(10),constraint n_k primary key(no));

    create table n2 (loc varchar2(10),no references n1(no) on delete cascade);


    SQL> select * from n2;

    LOC NO
    ---------- ----------
    delhi 1

    SQL> select * from n1;

    NO NAME
    ---------- ----------
    1 mmm
    2 nnn
    3 xxx



    SQL> delete n1 where no=1;

    1 row deleted.

    SQL> select * from n2;

    no rows selected

    Thanks in advance
    mohan

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: trigger for update

    Originally posted by mohan
    When using "ON DELETE CASCADE " data in child tables automatically removed when parent table gets deteted

    How to write trigger for update .
    You may find this useful:

    http://asktom.oracle.com/~tkyte/upda...ade/index.html

  3. #3
    Join Date
    Oct 2002
    Posts
    78

    hai

    Thanks andrew for your quick reply.That is what exactully i want.

    Regards
    mohan

Posting Permissions

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