If you can, post the description of the table itself:

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:

TO_DATE('01-FEB-2002' ,'dd-mon-yyyy')
The /pattern/ MUST be able to recognise the entire string, so every string you pass in must follow the same pattern.

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


In reply to Re: Re: Binding a date in a call to an Oracle function by seaver
in thread Binding a date in a call to an Oracle function by pete_c

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.