×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to write trigger on a table which insert record in itself.

How to write trigger on a table which insert record in itself.

How to write trigger on a table which insert record in itself.

(OP)
HI,

 I am facing some problems while writting database trigger in
 Firebird database.
 My basic requirement is to insert record into table on which i am
 writing update trigger.
 In Oracle i have written row leve trigger and statment level
 trigger
 to achieve this.
 Ex :
 Say I want to insert record into TABLE1 on update of same table.
 on update of TABLE1 i am going to insert record in PL/SQL package
 .
 which will be used to AFTER UPDATE STATEMENT LEVEL trigger on same
 table to insert record into TABLE1.

 Same thing i want in interbase/Firebird. I would like to know how
 it can be acheived?

 I have tried in interbase by writing
 AFTER UPDATE TRIGGER on TABLE1 and tried to insert record with old
 values on TABLE1

 Ex:
   create trigger upd... for TABLE1 ...
   AFTER UDPATE..
   BEGIN
      INSERT INTO TABLE1 VALUES(OLD.N, OOLD.NAME);
   END

 But on update of TABLE1 it goes on updating and never terminate.
 May be it goes into infinite loop. Ultimately i have to stop the
 firebird service . otherwise it go on increasing database file
 size.
 I would highly appreciate if you can suggest me any good
 solution.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close