Home » Developer & Programmer » Application Express, ORDS & 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: 21806
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: 21806
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: Thu Mar 28 18:20:32 CDT 2024