From: Jonathan C. <cra...@pc...> - 2003-02-21 18:36:10
|
steve fischer wrote: > > Jonathan- is there an easy way in perl to get an oracle compatible date? > The problem is that you're relying on Oracle's implicit conversion (from a string to a DATE type) which will only work if the format of the provided string matches the default NLS_DATE_FORMAT of the Oracle instance in question. We should instead use the TO_DATE function to do an explicit conversion from string -> DATE. Using TO_DATE you can specify the format along with the string, so there's no chance of a mismatch. Here's the man page for TO_DATE: <http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/server.901/a90125/functions134.htm#1003595> We probably should use something like this: TO_DATE('2002/12/6', 'YYYY/MM/DD') (assuming that the date is December 6th, not June 12th.) Jonathan -- Jonathan Crabtree Center for Bioinformatics, University of Pennsylvania 1406 Blockley Hall, 423 Guardian Drive Philadelphia, PA 19104-6021 215-573-3115 |