Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:18:11+00:00 2026-06-13T23:18:11+00:00

According to requirenments I need to support two mandatory columns for each table: ADDED_DATE,

  • 0

According to requirenments I need to support two mandatory columns for each table: ADDED_DATE, MODIFIED_DATE.
These are intended for DBA/auditing purposes.

Is it possible to make this stuff totally automatic, implicitly supported by DB itself when I’m inserting / updating records from within application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:18:12+00:00Added an answer on June 13, 2026 at 11:18 pm

    create a trigger on the table (before update for each row).

    SQL> create table foo (hi varchar2(10), added_date date, modified_date date);
    
    Table created.
    
    SQL> create trigger foo_auifer
      2  before update or insert on foo
      3  for each row
      4  declare
      5  begin
      6    if (inserting) then
      7      :new.added_date := sysdate;
      8    elsif (updating) then
      9      :new.modified_date := sysdate;
     10    end if;
     11  end;
     12  /
    
    Trigger created.
    
    SQL> insert into foo (hi) values ('TEST');
    
    1 row created.
    
    SQL> insert into foo (hi) values ('TEST2');
    
    1 row created.
    
    SQL> update foo set hi = 'MODDED' where rownum  = 1;
    
    1 row updated.
    
    SQL> alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
    
    Session altered.
    
    SQL> select * from foo;
    
    HI         ADDED_DATE           MODIFIED_DATE
    ---------- -------------------- --------------------
    MODDED     07-nov-2012 15:28:28 07-nov-2012 15:28:39
    TEST2      07-nov-2012 15:28:30
    
    SQL>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Generally, table has a fixed row height but according to my requirements I need
I am working with google map. According to requirements i need to set different
I have an action listener : myText.addEventListener(TextEvent.LINK,linkClickHandler); As according to this, i need to
I have a table in mnesia and I need to update individual fields in
I'm Windows user. But according to my project requirements, I need to write Linux
According to android icon design guidelines ( here , see table #1), developer needs
I met with a requirement for my magento project, according this I need to
According to the requirement i only need minimum input in event store for adding
I need to create a function that returns a table of continuous dates. I
According to Apple's documentation , NSOutlineView requires each item in the view to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.