Home » Developer & Programmer » Forms » Proplem in storing data and time in the field
Proplem in storing data and time in the field [message #291106] Thu, 03 January 2008 00:51 Go to next message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
i have problem in saving date and time in date filed

this is first time i face it in forms
i know oracle by default save date and time in the date field

i define start_date as timestamp field and in the property pallete oe the form i define the data type as datetime and the format mask dd-mm-yyyy when i run the form the user enter the date but when it save in the database it always give me that the date and time but the time is incorrect it gives me always 12:00:00 AM
never change




i dont know how to solve this problem i want the user to put the date and in the database it well save both data and time

any one have a way to solve my problem

[Updated on: Thu, 03 January 2008 00:52]

Report message to a moderator

Re: Proplem in storing data and time in the field [message #291121 is a reply to message #291106] Thu, 03 January 2008 01:33 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:

i define the data type as datetime and the format mask dd-mm-yyyy
You only done that. What do you expect from Oracle Forms? Do you think that it will convert dd-mm-yyyy as dd-mm-yyyy hh24:mi:ss?

Do it yourself.

By
Vamsi
Re: Proplem in storing data and time in the field [message #291151 is a reply to message #291121] Thu, 03 January 2008 03:19 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In my opinion, question itself doesn't make sense.

For example, if user enters (in dd.mm.yyyy format) value '30.03.2007', it - obviously - doesn't contain time information (actually, it does, but it defaults to 0:00:00). Now, what would be the correct time in your opinion, Lazygirl? Would it be 2:13:28 or 14:33:19 or something else? Perhaps time taken from the SYSDATE? If so, why would you want to do that?

In other words: if you chose to use item format as 'dd-mm-yyyy', you can not expect to have time in there. If you want to have time, change format to 'dd-mm-yyyy hh24:mi:ss' (for example), but it will force user to enter values in this format.

What to do? Well, it depends on business requirement. Talk to someone in business team and see what he/she says about it.
Re: Proplem in storing data and time in the field [message #291179 is a reply to message #291106] Thu, 03 January 2008 05:13 Go to previous messageGo to next message
LAZYGIRL
Messages: 34
Registered: May 2006
Member
dear vamsi kasina and Littlefoot

thanks alot for reply i finally solve problem

the field define as timestamp

and in the form data type datetime
and intial value $$DATETIME$$

and format mask dd-mm-yyyy

so the user well enter the date without able to see the time and in the databse it well save the date and time



[Updated on: Thu, 03 January 2008 05:24]

Report message to a moderator

Re: Proplem in storing data and time in the field [message #291261 is a reply to message #291179] Thu, 03 January 2008 09:51 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quoting and answering at the same time:
Quote:

- so the user will enter the date -> true
- without able to see the time -> true

- and in the databse it well save the date and time -> true, only that time will be 0:00:00 again

The only way to store time is
a) to leave the default value ($$datetime$$)
b) let user enter date AND time

In other words, you did not solve the problem.
Previous Topic: problem with inserting through forms in oracle apps (template.fmb)
Next Topic: List element
Goto Forum:
  


Current Time: Sun Feb 09 21:35:03 CST 2025