home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / NeXTanswers / AsciiFiles / Patches / OracleAdaptor / 1552_OracleAdaptor_ReadMe.txt
Encoding:
Text File  |  1994-04-11  |  2.7 KB  |  73 lines

  1. 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 :
  2.  
  3. * 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.  
  4. (Bug Ref#40437, Ref#38749)
  5.  
  6.  
  7. With this patched adaptor, you can use a dwrite to change the default date format which is currently specified as "MM/DD/YYYY".
  8.  
  9. In a terminal shell, specify the following dwrite:
  10.  
  11. localhost> dwrite MyApp OracleAdaptorDateFormat "DD Year Month HH:MI:SS"
  12.  
  13. 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.
  14.  
  15. * If the dwrite solution is not generic enough, you can change your application code to include the following methods:
  16.  
  17. @interface DBDatabase (DateFormatStringExtensions)
  18.  
  19. - (const char *)dateFormat;
  20.     // This returns the current date format string used by the
  21.     // adaptor.  It will never return NULL.
  22.  
  23. - (const char *)defaultDateFormat;
  24.     // By default this returns "MM/DD/YYYY".  This default date
  25.     // format can be overridden by a dwrite:
  26.     // % dwrite <AppName> OracleAdaptorDateFormat "<format string>"
  27.     // This method never returns NULL.
  28.  
  29. - setDateFormat:(const char *)newDateFormat;
  30.     // This method is used to set the date format used by the
  31.     // adaptor.  It will override the built-in and dwrite
  32.     // defaults.  If newDateFormat is NULL, the default date
  33.     // format will be used.  This method returns self.
  34.  
  35. @end
  36.  
  37. 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:
  38.  
  39. - appDidInit:sender
  40. {
  41.     [[module database] setDelegate:self];
  42.  
  43.     fprintf(stderr, "current date format %s\n", 
  44.             [[module database] dateFormat]);
  45.     [[module database] setDateFormat:"DDth Month/YYYY"];
  46.  
  47.     return self;
  48. }
  49.  
  50.  
  51.  
  52. Usage
  53. Hardlink to this patched oracle adaptor by adding the following option to your Makefile.preamble
  54. OTHER_OFILES = /MyDirectory/OracleAdaptor.adaptor/OracleAdaptor
  55.  
  56. Known Problems not fixed in this Oracle Adaptor Patch
  57.  
  58. Bug Reference 39247
  59.  
  60. Identical names in joined tables generate ambiguous queries that fail.
  61. The Oracle server will generate the following error message:
  62. ORA-00918 Column Ambiguously defined.
  63.  
  64. Workaround: Use different names.
  65.  
  66. Bug Reference 41992
  67.  
  68. Update of date fields alone will fail.
  69. The Oracle server will generate the following error message:
  70. Can't execute oracle cursor.
  71.     ORA-01008: not all variables bound
  72.  
  73. Workaround: Update a non-date field in addition to the date field.