Apple Enterprise - NeXTanswers Support Archive
Enterprise
[Index]
[Download]


Search NeXTanswers for:

This is a MAB version of the Oracle Adaptor based on the Pre-Release 3.3 version of the Oracle Adaptor. It contains the following bug fix :

* The default Oracle date format in Release 3.2 does not return time. It hardcodes TO_CHAR(columnName, 'MM/DD/YYYY') when it extracts a date/time.
(Bug Ref#40437, Ref#38749)


With this patched adaptor, you can use a dwrite to change the default date format which is currently specified as "MM/DD/YYYY".

In a terminal shell, specify the following dwrite:

localhost> dwrite MyApp OracleAdaptorDateFormat "DD Year Month HH:MI:SS"

Note: You can specify any valid SQL format string. You can have a different format string for each application. Note that the dwrite only applies to a single machine and to a particular application. You would have to specify the dwrite on each machine individually.

* If the dwrite solution is not generic enough, you can change your application code to include the following methods:

@interface DBDatabase (DateFormatStringExtensions)

- (const char *)dateFormat;
// This returns the current date format string used by the
// adaptor. It will never return NULL.

- (const char *)defaultDateFormat;
// By default this returns "MM/DD/YYYY". This default date
// format can be overridden by a dwrite:
// % dwrite <AppName> OracleAdaptorDateFormat "<format string>"
// This method never returns NULL.

- setDateFormat:(const char *)newDateFormat;
// This method is used to set the date format used by the
// adaptor. It will override the built-in and dwrite
// defaults. If newDateFormat is NULL, the default date
// format will be used. This method returns self.

@end

In your application code, you can set the format inside appDidInit: for instance, by sending to the DBDatabase instance variable the method setDateFormat. For example:

- appDidInit:sender
{
[[module database] setDelegate:self];

fprintf(stderr, "current date format %s\n",
[[module database] dateFormat]);
[[module database] setDateFormat:"DDth Month/YYYY"];

return self;
}



Usage
Hardlink to this patched oracle adaptor by adding the following option to your Makefile.preamble
OTHER_OFILES = /MyDirectory/OracleAdaptor.adaptor/OracleAdaptor

Known Problems not fixed in this Oracle Adaptor Patch

Bug Reference 39247

Identical names in joined tables generate ambiguous queries that fail.
The Oracle server will generate the following error message:
ORA-00918 Column Ambiguously defined.

Workaround: Use different names.

Bug Reference 41992

Update of date fields alone will fail.
The Oracle server will generate the following error message:
Can't execute oracle cursor.
ORA-01008: not all variables bound

Workaround: Update a non-date field in addition to the date field.


OpenStep | Alliances | Training | Tech Support | Where to Buy