Db2 - Trigger


Main Menu        Computer Tips        Software Downloads Menu

  Main Question - Posted From Guest:
I have a table1 it has updated records of a week and i have one more table table2 which has table1's history.... In table2 i have one more field than table1 say ID.. I want to increment ID by one every insert statement from table1 to table2 for all last week's data.. Can any one help me ?

Guest Says:
It sounds like you mean a one time run for table2 to increement the ID field for every row. It's hard to tell with so little info given but I would just run an update statement and set every ID field to ID + 1, unless you are going to dup out on the keys if they are unique and they are going to match each other or match other rows on the table. There are a ton more factors involved here then just throwing up a few words and saying "how do I do it", its like taking your car to a shop and saying "fix it, it seems broken".


Add your reply below ...



This site allows you to ask questions and get answers from various posters, you may also answer any posts if you feel like you have input to give. Feel free to ask for help with any new question you wish, but most of the questions here are tech related. You will find many questions and answers related to your Ipod or Ipod Nano, Itunes, audio and video converting, spyware or adware cleanup, pc or other computer questions, and even mainframe questions. Although these are the tech questions most often asked, you will find help on almost any computer or software related subject. Feel free to go to the main menu and review the posts already present, or feel free to ask your own question. (Some questions will be closed once the moderator feels they are sufficiently answered and that no other input is needed).

Your Name:

Your Reply:

Type in verification code:


Main Menu

Shareware and Freeware Database

Tasks and Spyware Database

Various Computer Help Topics