i have created a table with the system date as one of the column:
create table nav_date as (SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS') "Current date" FROM dual)
------------------------------------------------------
how to get the current system date in the table whenever i select * the table nav_date?
need help in automatic update
Moderator: General Moderators
need help in automatic update
Last edited by ali560045 on Tue Jun 24, 2008 1:31 am, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: need help in automatic update
You need to UPDATE that field each time or use a function rather than store the date.
(#10850)
Re: need help in automatic update
As arborint said, you don't need to store the date in the table if you're just going to update it every time you look at the record. And by the way, you don't ever "open" a table, as you would a file. You merely access the data in a table, so there is no "open" event associated with a table.ali560045 wrote:i have created a table with the system date as one of the column:
create table nav_date as (SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS') "Current date" FROM dual)
------------------------------------------------------
how to get the current system date in the table whenever i open the table nav_date?
Re: need help in automatic update
so can anyone help me getiing the function defined here instead of storing the date in the table.
i think thats the only way of solving this problem.
thanks for the above replies
i think thats the only way of solving this problem.
thanks for the above replies
Re: need help in automatic update
The current system date is always available simply as date(). Just use that expression in your PHP code when you want the current system date. http://www.w3schools.com/PHP/php_date.asp
If you are talking about some other date, such as the date a particular record was added or modified, that's an entirely different question, but you indicated you wanted to know the current date/time whenever you accessed a table.
If you are talking about some other date, such as the date a particular record was added or modified, that's an entirely different question, but you indicated you wanted to know the current date/time whenever you accessed a table.