Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLTable default values for timestamp results in ORA-01843: not a valid month

siromegaAug 15 2013 — edited Aug 20 2013

When I try to provide a default for a timestamp value in the XMLTABLE function, I am greeted with an error - ORA-01843: not a valid month - no matter how I provide that default value. Whether there is a value present in the XML or not is irrelavant for this bug to occur. It appears to be an incomplete fix of bug number 9745897 (thread).

select x.*

from

xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')

  COLUMNS dt timestamp default sysdate) x;

select x.*

from

xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')

  COLUMNS dt timestamp default systimestamp) x;

select x.*

from

xmltable('/DOC' passing xmltype('<DOC><DT>2013-08-14T15:08:31</DT></DOC>')

  COLUMNS dt timestamp default to_char(systimestamp, 'YYYY-MM-DD"T"HH24:MI:SS') ) x;

Edit: A little more followup.

This works:

select x.*

from

xmltable('/DOC' passing xmltype('<DOC></DOC>')

  COLUMNS dt date default sysdate) x;

This also works, except for its just the date, and not the date/time

select x.*

from

xmltable('/DOC' passing xmltype('<DOC></DOC>')

  COLUMNS dt timestamp default sysdate) x;

This doesn't work

select x.*

from

xmltable('/DOC' passing xmltype('<DOC></DOC>')

  COLUMNS dt timestamp default systimestamp) x;

ORA-01861: literal does not match format string

This post has been answered by odie_63 on Aug 16 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2013
Added on Aug 15 2013
2 comments
2,775 views