Error is FRM-50012 date format [message #614965] |
Thu, 29 May 2014 03:56 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/a59247482a11edb9544247f102223e8d?s=64&d=mm&r=g) |
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi,
I have to database fields . A and B both of them Datatype is Date.
In oracle Forms 6i Format is Day when I enter day Friday it is not Accepting. Error is FRM-50012 date format must be like Day.
please tell me how to solve this issue.
Thanks
|
|
|
|
|
|
Re: Error is FRM-50012 date format [message #614978 is a reply to message #614973] |
Thu, 29 May 2014 04:48 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I have no idea what you're trying to do because what you've posted so far makes no sense.
1) is hiredate actually varchar in your DB, or is it a date? Because if it's date (which it should be) then that to_Date shouldn't be there.
2) Dates do not have formats. repeat that 10 times. Then read this: http://edstevensdba.wordpress.com/category/nls_date_format/
then repeat it a few more times.
v_date is a date, it will not hold data in the Day format, because like all dates it doesn't hold the data in any recognizable format. If you want to store a date in a particular format you need to put it in a varchar.
3) Assuming v_date was a varchar it would hold a value like 'Thursday'. 'Thursday' is not a valid format mask.
|
|
|
|
|
|
Re: Error is FRM-50012 date format [message #614989 is a reply to message #614978] |
Thu, 29 May 2014 05:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
cookiemonster wrote on Thu, 29 May 2014 10:48I have no idea what you're trying to do because what you've posted so far makes no sense.
You need to explain what you want in words, rather than meaningless code.
|
|
|
|
|
|
|
|
|
Re: Error is FRM-50012 date format [message #615012 is a reply to message #615003] |
Thu, 29 May 2014 07:36 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If the format mask of the item is set to 'Day', which is not what the code above does, then you should be able to enter a day of the week into the field. However, even with the mask set to Day a date is still a date, so if you enter Thursday, the date item will be set to a particular Thursday, and probably not the one you want:
SQL> SELECT to_char(to_date('Thursday', 'Day'), 'DD-MON-YYYY') FROM dual;
TO_CHAR(TO_DATE('THURSDAY','DA
---------------------------------------------------------------------------
01-MAY-2014
|
|
|
|
|
|
Re: Error is FRM-50012 date format [message #615118 is a reply to message #615115] |
Fri, 30 May 2014 07:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Why are you trying to have the date in format? What is the point of it?
You've repeated told me you want the date in day format. I've told you why your existing code doesn't work, I've told you how to do it, and I've pointed out that just entering a day will probably give a date you don't expect.
You've acknowledged that this last point is problem for what you are trying to achieve, but you still haven't actually told me what you are trying to achieve, beyond just having the fields in Day format. I can't suggest a solution until you explain the purpose of using Day.
I did ask if you were using Day for one particular reason above and your response seemed to have nothing to do with what I asked.
|
|
|
|