in reply to Re: Binding a date in a call to an Oracle function
in thread Binding a date in a call to an Oracle function
describe table
If the offending column is a 'datetime' column, then it will only accept 'datetime' objects, an oracle specific 'format'. Oracle doesn't care what's IN the 'datetime' objects, except that they must be a 'datetime' object. The ToDate() function dragonchild mentions converts whatever the string is into a 'datetime' object according to the /pattern/ you use in the function, for example:
The /pattern/ MUST be able to recognise the entire string, so every string you pass in must follow the same pattern.TO_DATE('01-FEB-2002' ,'dd-mon-yyyy')
Be warned, when you look for your dates in the table, they will NOT neccessarily come back to you in the same format as you declared in the TO_DATE function. This is because Oracle has its own 'datetime' format constant, which is applied to all 'datetime' formats when they are called FROM the database. This can be changed, though I forget what the constant is called.
Cheers
Sam
|
|---|