On 4/7/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Mario Weilguni <mweilguni@sime.com> writes:
> > I think all except the first one should raise a warning, isn't it?
>
> to_timestamp (and friends) all seem to me to act pretty bizarre when
> faced with input that doesn't match the given format string. However,
> in the end that is an Oracle-compatibility function, and there is only
> one measure of what it should do: what does Oracle do in the same case.
> Can anyone try these examples on a recent Oracle version?
In Oracle10g Express those dates are rejected as invalid :
SQL> select to_timestamp('00000000 0300','yyyymmdd hh24mi') from dual;
select to_timestamp('00000000 0300','yyyymmdd hh24mi') from dual *
ERROR at line 1:
ORA-01843: not a valid month
SQL> select to_timestamp(' 0300','yyyymmdd hh24mi') from dual;
select to_timestamp(' 0300','yyyymmdd hh24mi') from dual *
ERROR at line 1:
ORA-01843: not a valid month
Cheers,
Adrian Maier