Solved

db2 question

Posted on 2001-06-20
2
480 Views
Last Modified: 2012-05-04
Hai all,

We are using DB2 database as our backend database. In this database i have a table that contains three columns.
First column is name of type varchar,
Second column is phnumber of type varchar,
Third Column is ctime of type timestamp.
With this table i want to insert persons name and phone number through the program which i am using and the third field has to be updated with the current time stamp automatically. I know to insert first two columns.I know it is possible with TRIGGERS.but i dont know how to use triggers.i am very new to TRIGGERS.
Please help me out with this regard.

thanks

bye.

0
Comment
Question by:naga1979
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
missionImpossible earned 20 total points
ID: 6209507
CREATE TRIGGER TriggerName AFTER insert ON yourTable REFERENCING OLD AS inserted FOR
EACH ROW MODE DB2SQL  BEGIN ATOMIC UPDATE yourTable SET ctime = CURRENT TIMESTAMP where name = inserted.name; END



For general syntax of triggers show in IBM-DB2-helpsystem
0
 
LVL 1

Author Comment

by:naga1979
ID: 6325493
Thanks

Cheers
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question