Board index » delphi » Read/Write a date on Oracle tables

Read/Write a date on Oracle tables


I can't read/write date on Oracle tables. The DbiDateDecode function can't
retrive the right values for day, month and year. I have try to use native
bde driver, ms odbc driver and oracle odbc driver without results.

May anybody help me to do this?

Thanks in advance.


Re:Read/Write a date on Oracle tables

I have never seen a problem in reading a date from Oracle.  But if the
Oracle date is coming back in default format (12-JUN-00), DecodeDate
will not work on it, since it expects dates in the ShortDateFormat.  The
easiest way is to change the Oracle NLS_DATE_FORMAT to agree with the
ShortDateFormat you are using.
To write Oracle dates, you can use the Oracle TO_DATE() function,
supplying the appropriate mask.

John Pierce

Other Threads