Skip to main content
Question

Oracle TO_DATE function into Where Clause

  • December 10, 2019
  • 1 reply
  • 580 views

philippeb
Enthusiast
Forum|alt.badge.img+22

Hello,

I have a table with millions of features. I need to use the Where Clause to extract what I want.

I'm using a Published Parameter to define a date. My problem is the date format into database (YYYY-MM-DD). And Data Inspector tells me it's encoded windows-1252, not string (don't know if it changes something).

I though to use into Where Clause the TO_DATE function to convert my dates. 

 TO_DATE('@Value(DATE_into_Database)', 'YYYYMMDD') => '$(DATE_FROM)'

But it's not working. I get an Unable to execute SQL statement. And I'm not even sure if it's supported by FME because this function isn't into the SQL Date Functions choices. I only have those (the help button sent me there) : SQL Date Functions 

Do you have an idea how I could extract those dates ?

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.

1 reply

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • December 10, 2019

I believe the published parameter is a date in char form YYYYMMDD:HHMINSS

So the easiest way would be converting the database date to a char, like this (assuming the DATE_into_Database is an Oracle table attribute):

TO_CHAR(DATE_into_Database, 'YYYYMMDD') => '$(DATE_FROM)'

Hope this helps.