Home » Developer & Programmer » Application Express & MOD_PLSQL » Date and time when row created
Date and time when row created [message #534738] Thu, 08 December 2011 14:34 Go to next message
warbie118
Messages: 7
Registered: December 2011
Junior Member
Hi all,

Am making an application with Oracle application express and on a form when i create a row in a database i want to display the time the row is created automatically.

Any help would be very appriciated Smile
Re: Date and time when row created [message #534740 is a reply to message #534738] Thu, 08 December 2011 15:17 Go to previous messageGo to next message
Littlefoot
Messages: 19476
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a database trigger, such as
create or replace trigger trg_auto_time
  before insert on your_table
  for each row
begin
  :new.row_created_date := sysdate;
end;
Re: Date and time when row created [message #534828 is a reply to message #534740] Fri, 09 December 2011 08:08 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
What I did was enter 'sysdate' into the "default value" box in the item you want it as, and then change the "default value type" to PL/SQL Expression. Works for me
though i've not been using apex for a huge amount of time so the other guy's way is probably better Razz
Re: Date and time when row created [message #534927 is a reply to message #534828] Sat, 10 December 2011 06:38 Go to previous messageGo to next message
Littlefoot
Messages: 19476
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
the other guy's way is probably better

Not at all! Database triggers way require you to know how to write them. Your (Apex default value) way requires you to know what function to use (it is SYSDATE). That's why the documentation saysQuote:
Using only a web browser and limited programming experience, you can develop
so - from my point of view - your way is probably even better than mine.
Re: Date and time when row created [message #535026 is a reply to message #534927] Sun, 11 December 2011 08:46 Go to previous message
warbie118
Messages: 7
Registered: December 2011
Junior Member
Thank you for your help Smile
Previous Topic: Email attachment help
Next Topic: Making a popup
Goto Forum:
  


Current Time: Fri Aug 22 17:22:33 CDT 2014

Total time taken to generate the page: 0.10589 seconds