Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-update a field?

Status
Not open for further replies.

ModelTrains

Programmer
Nov 12, 2002
40
US
Every table in my database has a LAST_UPDATE_DT (Timestamp) column. What are my options to make this an automatically updated field when an application updates the record?

Example:
COMPANY table:
company_key
company_name
last_update_dt

The programmer would use the following SQL:

"insert into company values (company_key, company_name)"

or at a later time in the application:

"update company set company_name=[variable] where company_key=123"

 
One option is to add pre-update triggers to these tables to value the last_update_dt column. This relieves the programmers from the responsibility since it will always be done automatically.

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
When posting code, please use TGML for readability. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top