Skip to main content
Question

Sorting date fields from Oracle numerically - error unless bulk mode broken

  • June 24, 2020
  • 4 replies
  • 39 views

ebygomm
Influencer
Forum|alt.badge.img+44

Possibly something that may already be addressed - this is in FME 2019.2.3.1

If reading a date time field from Oracle, if you try to sort this field numerically you get an error message, presumably because the date times are seen as strings

Failed to sort Feature Table. Ensure fields you wish to sort by are of a sortable type

Breaking bulk mode, e.g. with a python caller,  addresses the issue and the sorter works.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • 648 replies
  • June 25, 2020

Hi @ebygomm

It looks like a similar error for 2019 was reported here (fixed for 2020.1). Are you using SQLExecutor or the regular reader to read from Oracle?


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • June 25, 2020

Have you tried

Select to_number(to_char(datefield,'YYYYMMDD')), datefield from table order by 1

That should return the dates, ordered numerically.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Author
  • Influencer
  • 3427 replies
  • June 25, 2020

Hi @ebygomm

It looks like a similar error for 2019 was reported here (fixed for 2020.1). Are you using SQLExecutor or the regular reader to read from Oracle?

Yes, thanks, looks like it's the same error. I'm using an sql executor. This workspace will be running in 2019 but it's good to be able to annotate the workaround with details of the issue and fix.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Author
  • Influencer
  • 3427 replies
  • June 25, 2020

Have you tried

Select to_number(to_char(datefield,'YYYYMMDD')), datefield from table order by 1

That should return the dates, ordered numerically.

It's not a problem to workaround now I know about it, it just means that this part of the workflow is subtly different from another part with a different input, but I can add the annotation to explain why.

It puzzled me for a bit because when i was setting it up I had feature caching on and running from cached data has no issues :-)