Re: Oracle ODBC driver 8.0 - Date parameters problem.

From: Osama Alrefai <Alrefai_Osama_H_at_email.cat.com>
Date: Thu, 13 Apr 2000 09:41:17 -0500
Message-ID: <38F5DC8D.6268FEA7_at_email.cat.com>


Your problem is that you are not specifying the format for accepting the date. In your sql statement, to insert a date field, you need to give the mask of the date field by using the TO_DATE function in Oracle. Let me give you an example: If I have a table called Tcc_Table, with the following column specs: +++++++++++++
Id NUMBER(10)
Tcc_Date DATE
+++++++++++++

If I want to insert a field in there, I need to do the following: INSERT INTO Tcc_Table VALUES (123, TO_DATE('13-04-2000','DD-MM-YYYY')); Where DD stands for day-day, MM for month-month (has to be a number with this mask, and can't be greator than 12), and YYYY stands for year-year-year-year. If you want to put the month as a 3 character field, then the mask for the month is (MON). If you need the full name of the month, the mask for the month will be (MONTH). By the way, it is not case sensitive. I am just putting it in this way so that you distinguish between data and ORACLE functions. To illustrate more, masks for what you have in this message are:

15-03-2000                  >>>>  DD-MM-YYYY
15-APR-00                  >>>>  DD-MON-YY
2000-02-18                  >>>> YYYY-MM-DD
2000-03-27 00:00:00 >>>> YYYY-MM-DD HH:MM:SS Osama Alrefai

Tcc wrote:

> I'm using MS-Query to connect my Oracle Server 8.0.5 with the ODBC driver
> 8.0. I add a parameter for a date fields. So if I press the refresh button,
> a window will prompt out and ask for entering a parameter. After I enter the
> parameter, the oracle server return message 'ORA-01843: Not a valid month'.
> I enter the parameter as:
>
> 15-03-2000; 15-APR-00; 2000-02-18; 2000-03-27 00:00:00; '13-APR-00';
> So what is the parameter format that I should use?
> Is that need to add some string or need to modify the values that enter?
>
> Thank for any one who try to help me.
Received on Thu Apr 13 2000 - 16:41:17 CEST

Original text of this message