Posted By: Ernie Y2K Problems? - 12/24/99 12:03 AM
I have problems where the TOraclePackage Component. Can somebody help ?

I call a procedure with CallProcedure method of TOraclePackage. This Procedure has 2 parameters : a Date and a Integer.

If the short date format on my Regional Settings of Control Panel have 'MM/dd/yyyy', the procedure works well. But if the format is 'MM/dd/yy' the procedure writes data like this : '01/03/1900' instead of '01/03/2000'.


Please Help. Microsoft says its not necessary to change the format and there are a lot of users in many countries....
Posted By: Marco Kalter Re: Y2K Problems? - 12/24/99 08:08 PM
The TOraclePackage does not have a Y2K problem. For dates it uses a TDateTime data type, which is not affected by the regional settings. If, however, you pass strings to date parameters or dates to string parameters, then you get implicit conversions between strings and dates. You are then depending on the regional settings of windows and the nls_date_format settings of the Oracle session.

You should always treat dates as dates in your application, and only convert to/from strings when they are represented on screen or in a file.


------------------
Marco Kalter
Allround Automations
Posted By: Ernie Re: Y2K Problems? - 12/28/99 03:55 AM
Thanks for your help. I use the "nls_date_format" to format the date.
it works.

Regards.
Posted By: techstar Re: Y2K Problems? - 01/25/00 05:03 AM
If you havce stored procedures and packages that use a string entry to get a date and do not want to or can not take the time to change the date, you can convert windows dates to Y2K strings using the following Delphi function:
strDate := formatDateTime( 'dd"/"mm"/"yyyy', DatePicker.Date);
The choice of the formatting string - 'dd"/"mm"/"yyyy' is up to you, but be sure it matches your expectations in Oracle.
© Allround Automations forums