Print Thread
Y2K Problems?
#221 12/24/99 12:03 AM
Joined: Dec 1999
Posts: 2
Monterrey NL
E
Ernie Offline OP
Member
OP Offline
Member
E
Joined: Dec 1999
Posts: 2
Monterrey NL
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....

Re: Y2K Problems?
#222 12/24/99 08:08 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
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


Marco Kalter
Allround Automations
Re: Y2K Problems?
#223 12/28/99 03:55 AM
Joined: Dec 1999
Posts: 2
Monterrey NL
E
Ernie Offline OP
Member
OP Offline
Member
E
Joined: Dec 1999
Posts: 2
Monterrey NL
Thanks for your help. I use the "nls_date_format" to format the date.
it works.

Regards.

Re: Y2K Problems?
#224 01/25/00 05:03 AM
Joined: Sep 1999
Posts: 25
Flowery Branch GA USA
T
Member
Offline
Member
T
Joined: Sep 1999
Posts: 25
Flowery Branch GA USA
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.


Perry Schwartz
TechStar International

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 13 (0.013s) Memory: 2.5042 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-05-05 05:29:34 UTC
Valid HTML 5 and Valid CSS